Skip to content

Commit

Permalink
fix reconsciler issue, fix couple ts issues (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustFly1984 committed Nov 22, 2020
1 parent fcd7930 commit 3e55c9a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/renderer.tsx
@@ -1,6 +1,7 @@
import * as THREE from 'three'
import * as React from 'react'
import * as Reconciler from 'react-reconciler'
// @ts-ignore
import Reconciler from 'react-reconciler'
// @ts-ignore
//import Reconciler from 'react-reconciler/cjs/react-reconciler.production.min'
import { unstable_now as now, unstable_IdlePriority as idlePriority, unstable_runWithPriority as run } from 'scheduler'
Expand Down Expand Up @@ -480,21 +481,18 @@ function switchInstance(instance: any, type: string, newProps: any, fiber: Recon
// TimeoutHandle,
// NoTimeout
// >
const Renderer = Reconciler<any, any, THREE.Object3D, any, any, any, any, any, any, any, any, any>({
const Renderer = Reconciler({
now,
createInstance,
removeChild,
appendChild,
insertBefore,
// @ts-ignore
warnsIfNotActing: true,
supportsMutation: true,
isPrimaryRenderer: false,
scheduleTimeout: is.fun(setTimeout) ? setTimeout : undefined,
cancelTimeout: is.fun(clearTimeout) ? clearTimeout : undefined,
// @ts-ignore
setTimeout: is.fun(setTimeout) ? setTimeout : undefined,
// @ts-ignore
clearTimeout: is.fun(clearTimeout) ? clearTimeout : undefined,
noTimeout: -1,
appendInitialChild: appendChild,
Expand Down Expand Up @@ -556,7 +554,7 @@ const Renderer = Reconciler<any, any, THREE.Object3D, any, any, any, any, any, a
// Returning true will trigger commitMount
return instance.__handlers
},
commitMount(instance: any, type, props) {
commitMount(instance: any /*, type, props*/) {
// https://github.com/facebook/react/issues/20271
// This will make sure events are only added once to the central container
const container = instance.__container
Expand Down

0 comments on commit 3e55c9a

Please sign in to comment.