React–useContext

  • Post author:
  • Post category:其他


在出现

useContext

之前,使用

context

的方式主要是两种,第一种需要使用

Consumer

class Component2 extends Component{
   
  render(){
   
    return (
      <CountContext.Consumer>
        {
   
          count => <div>



版权声明:本文为hjc256原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。