Update api.md

This commit is contained in:
Paul Henschel
2020-07-30 10:44:04 +02:00
committed by GitHub
parent cfb9d31226
commit 365bb3d09d

5
api.md
View File

@@ -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 */}
```