Skip to content

Commit 37e6499

Browse files
chore: resolve conflicts
1 parent ded1acd commit 37e6499

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"eslint:fix": "yarn run eslint --fix",
3434
"test": "jest --coverage",
3535
"test:watch": "jest --watchAll",
36-
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict --jsx react",
36+
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict",
3737
"validate": "preconstruct validate",
3838
"release": "yarn build && yarn changeset publish",
3939
"vers": "yarn changeset version",

packages/fiber/src/core/renderer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ function Provider<TCanvas extends HTMLCanvasElement | OffscreenCanvas>({
474474
children,
475475
onCreated,
476476
rootElement,
477-
}: ProviderProps<TCanvas>): JSX.Element {
477+
}: ProviderProps<TCanvas>): React.JSX.Element {
478478
useIsomorphicLayoutEffect(() => {
479479
const state = store.getState()
480480
// Flag the canvas active, rendering will now begin
@@ -529,7 +529,7 @@ export type InjectState = Partial<
529529
}
530530
>
531531

532-
export function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element {
532+
export function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.JSX.Element {
533533
return <Portal children={children} container={container} state={state} />
534534
}
535535

@@ -539,7 +539,7 @@ interface PortalProps {
539539
container: THREE.Object3D
540540
}
541541

542-
function Portal({ state = {}, children, container }: PortalProps): JSX.Element {
542+
function Portal({ state = {}, children, container }: PortalProps): React.JSX.Element {
543543
/** This has to be a component because it would not be able to call useThree/useStore otherwise since
544544
* if this is our environment, then we are not in r3f's renderer but in react-dom, it would trigger
545545
* the "R3F hooks can only be used within the Canvas component!" warning:

packages/fiber/src/three-types.ts

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import type * as THREE from 'three'
2+
import type {} from 'react'
3+
import type {} from 'react/jsx-runtime'
4+
import type {} from 'react/jsx-dev-runtime'
25
import type { Args, EventHandlers, InstanceProps, ConstructorRepresentation } from './core'
36

47
type NonFunctionKeys<P> = { [K in keyof P]-?: P[K] extends Function ? never : K }[keyof P]
@@ -66,3 +69,15 @@ declare module 'react' {
6669
interface IntrinsicElements extends ThreeElements {}
6770
}
6871
}
72+
73+
declare module 'react/jsx-runtime' {
74+
namespace JSX {
75+
interface IntrinsicElements extends ThreeElements {}
76+
}
77+
}
78+
79+
declare module 'react/jsx-dev-runtime' {
80+
namespace JSX {
81+
interface IntrinsicElements extends ThreeElements {}
82+
}
83+
}

0 commit comments

Comments
 (0)