函数: useContext()
useContext<
T>(context:Context<T>):T
接受一个 context 对象(React.createContext 返回的值),并返回
当前的 context 值,即该 context 最近的 provider 所提供的值。
类型参数
参数
返回
T
Version
16.8.0
useContext<
T>(context:Context<T>):T
接受一个 context 对象(React.createContext 返回的值),并返回
当前的 context 值,即该 context 最近的 provider 所提供的值。
T
16.8.0