Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/components/unity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export function Unity(props: IUnityProps): ReactElement {
// When the application is loaded, we'll send over a reference to the
// canvas element. When the HTML Canvas Element ref is defined, an event
// will be dispatched.
if (htmlCanvasElement !== null) {
unityContext.dispatchEvent("canvas", htmlCanvasElement);
if (htmlCanvasElement.current !== null) {
unityContext.dispatchEvent("canvas", htmlCanvasElement.current);
}
// The loaded event is dispatched.
unityContext.dispatchEvent("loaded");
Expand Down