You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import"./styles.css";import{Stage,Container}from"react-pixi-fiber";import{createContext,FunctionComponent,useContext}from"react";constContext=createContext<{title: string}>((nullasany)as{title: string});constWrapper: FunctionComponent=({ children })=>{constcontext=useContext(Context);// following will throwif(!context)thrownewError("context not defined");return<Container>{children}</Container>;};exportdefaultfunctionApp(){return(<Context.Providervalue={{title: "hello"}}><divclassName="App"><Stage><Wrapper/></Stage></div></Context.Provider>);}
I would expect context will be available in Wrapper.
Additional info
react-pixi-fiber version: 1.0.0-beta.9
React version: 17.0.2
ReactDOM version: 17.0.2
PixiJS version: 6.0.2
The text was updated successfully, but these errors were encountered:
kresli
changed the title
context not available in stage's children
context not available in <Stage> children
May 9, 2021
I would expect context will be available in Wrapper.
Additional info
The text was updated successfully, but these errors were encountered: