mirror of
https://github.com/zhigang1992/react-three-fiber.git
synced 2026-04-29 04:45:22 +08:00
Update api.md
This commit is contained in:
5
api.md
5
api.md
@@ -434,9 +434,8 @@ At the moment React context [can not be readily used between two renderers](http
|
||||
const forwardContext = React.createContext()
|
||||
|
||||
function App() {
|
||||
const state = useContext(forwardContext)
|
||||
return (
|
||||
<Canvas>
|
||||
<forwardContext.Provider value={state}>
|
||||
{/* children can now read from forwardContext */}
|
||||
<forwardContext.Provider value={useContext(originalContext)}>
|
||||
{/* children can now read state from forwardContext */}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user