File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ import { IUnityInstanceParameters } from "../interfaces/unity-instance-parameter
66
77// TODO turn into functional component
88export class Unity extends PureComponent < IUnityProps , { } > {
9+ /**
10+ * A counter to track the number of times a unique identifier was generated.
11+ */
12+ private static uniqueIdentifiers : number = 0 ;
13+
914 /**
1015 * The UnityContext passed by the props.
1116 * @private
@@ -138,6 +143,7 @@ export class Unity extends PureComponent<IUnityProps, {}> {
138143 */
139144 public render ( ) : React . ReactNode {
140145 return createElement ( "canvas" , {
146+ id : `unity-canvas-${ Unity . uniqueIdentifiers ++ } ` ,
141147 ref : ( ref : HTMLCanvasElement ) => ( this . htmlCanvasElementReference = ref ) ,
142148 className : this . props . className || "" ,
143149 tabIndex : this . props . tabIndex || undefined ,
You can’t perform that action at this time.
0 commit comments