Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
Canvas3D.displayName = 'Canvas3D'
Canvas3D.propTypes = utils.assignIf(
{
backgroundColor: T.any,
lights: T.array,
camera: T.object,
objects: T.oneOfType([T.array, T.object]).isRequired,
antialias: T.bool,
onBackgroundClick: T.func,
rendererClass: T.func
},
ReactCanvasBase.commonPropTypes
)
/**
* Ancestors React components may provide these context values to override
* how the world is created, e.g. switching to a WebXR-aware world impl
*/
Canvas3D.contextType = React.createContext({
worldFacade: World3DFacade,
worldProps: {},
onCanvasRef: null,
canvasStyle: null
})
export default Canvas3D
}, props.worldProps)
}),
props.children
)
}
}
Canvas2D.displayName = 'Canvas2D'
Canvas2D.propTypes = utils.assignIf(
{
backgroundColor: T.any,
objects: T.oneOfType([T.array, T.object]).isRequired,
onBackgroundClick: T.func
},
ReactCanvasBase.commonPropTypes
)
export default Canvas2D