Skip to content

Commit

Permalink
fix(createPortal): use correct JSX type (#2550)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Oct 4, 2022
1 parent 4069fe9 commit 236cc65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/fiber/src/core/index.tsx
Expand Up @@ -406,7 +406,7 @@ export type InjectState = Partial<
}
>

function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.ReactNode {
function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element {
return <Portal key={container.uuid} children={children} container={container} state={state} />
}

Expand All @@ -418,7 +418,7 @@ function Portal({
children: React.ReactNode
state?: InjectState
container: THREE.Object3D
}) {
}): JSX.Element {
/** This has to be a component because it would not be able to call useThree/useStore otherwise since
* if this is our environment, then we are not in r3f's renderer but in react-dom, it would trigger
* the "R3F hooks can only be used within the Canvas component!" warning:
Expand Down

0 comments on commit 236cc65

Please sign in to comment.