Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
objects: props.objects,
fog: props.fog,
onBackgroundClick: props.onBackgroundClick
},
context.worldProps,
props.worldProps
)
}),
props.children
)
}
}
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
*/
utils.assign({}, props, {
worldFacade: props.worldFacade || World2DFacade,
worldProps: utils.assign({}, {
backgroundColor: props.backgroundColor,
onBackgroundClick: props.onBackgroundClick,
objects: props.objects
}, 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