What is the scoping logic behind React states being used inside functions in custom hooks?

后端 未结 0 1179
故里飘歌
故里飘歌 2021-02-13 12:37

So say you have a custom hook:

useCustomHook()=>{
  const [state, setState] = React.useState(0);
  
  const modifyState = ({state, n}) => {setState(state +          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题