🏷️coa-lee-dev/📌Study/⚛️ReactJS/
useState의 기본값으로 props를 쓰지마라 읽기
Search

useState의 기본값으로 props를 쓰지마라 읽기

Do not use props as default value of React.useState() directly
React Hooks has been used more and more often right now. But I saw some people using it in wrong way. Here is an example once we click the button, state in App changed, but we can see child component Box doesn't change. How come child didn't change?
Do not use props as default value of React.useState() directly
https://medium.com/@digruby/do-not-use-props-as-default-value-of-react-usestate-directly-818ee192f454
Do not use props as default value of React.useState() directly
Copyright 2021 Bonhaeng Lee