我是看react.d.ts中才看到ProviderProps有个children参数,这在官网提都没提过啊。
function Demo(props){ return ( <CustomContext.Provider children={props.children} value={{}} /> ); }
https://react.docschina.org/d...看Context篇章
1.4m articles
1.4m replys
5 comments
57.0k users