Skip to content

Commit

Permalink
chore: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed May 8, 2024
1 parent ded1acd commit 37e6499
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"eslint:fix": "yarn run eslint --fix",
"test": "jest --coverage",
"test:watch": "jest --watchAll",
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict --jsx react",
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict",
"validate": "preconstruct validate",
"release": "yarn build && yarn changeset publish",
"vers": "yarn changeset version",
Expand Down
6 changes: 3 additions & 3 deletions packages/fiber/src/core/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function Provider<TCanvas extends HTMLCanvasElement | OffscreenCanvas>({
children,
onCreated,
rootElement,
}: ProviderProps<TCanvas>): JSX.Element {
}: ProviderProps<TCanvas>): React.JSX.Element {
useIsomorphicLayoutEffect(() => {
const state = store.getState()
// Flag the canvas active, rendering will now begin
Expand Down Expand Up @@ -529,7 +529,7 @@ export type InjectState = Partial<
}
>

export function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element {
export function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.JSX.Element {

Check failure on line 532 in packages/fiber/src/core/renderer.tsx

View workflow job for this annotation

GitHub Actions / Build, lint, and test

Replace `children:·React.ReactNode,·container:·THREE.Object3D,·state?:·InjectState` with `⏎··children:·React.ReactNode,⏎··container:·THREE.Object3D,⏎··state?:·InjectState,⏎`
return <Portal children={children} container={container} state={state} />
}

Expand All @@ -539,7 +539,7 @@ interface PortalProps {
container: THREE.Object3D
}

function Portal({ state = {}, children, container }: PortalProps): JSX.Element {
function Portal({ state = {}, children, container }: PortalProps): React.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
15 changes: 15 additions & 0 deletions packages/fiber/src/three-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type * as THREE from 'three'
import type {} from 'react'
import type {} from 'react/jsx-runtime'
import type {} from 'react/jsx-dev-runtime'
import type { Args, EventHandlers, InstanceProps, ConstructorRepresentation } from './core'

type NonFunctionKeys<P> = { [K in keyof P]-?: P[K] extends Function ? never : K }[keyof P]
Expand Down Expand Up @@ -66,3 +69,15 @@ declare module 'react' {
interface IntrinsicElements extends ThreeElements {}
}
}

declare module 'react/jsx-runtime' {
namespace JSX {
interface IntrinsicElements extends ThreeElements {}
}
}

declare module 'react/jsx-dev-runtime' {
namespace JSX {
interface IntrinsicElements extends ThreeElements {}
}
}

0 comments on commit 37e6499

Please sign in to comment.