状态:React Context + State 源码
州立 使用编写本地状态,并仅在需要时以最小的努力将其提升到 。 :joystick: CodeSandbox演示 :joystick: 基本例子 import React , { useState } from " react " ; import constate from " constate " ; // :keycap_1: Create a custom hook as usual function useCounter () { const [ count , setCount ] = useState ( 0 ); const increment = () => se
用户评论