Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(createPortal): use correct JSX type #2550

Merged
merged 1 commit into from Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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