> For the complete documentation index, see [llms.txt](https://shhn0509.gitbook.io/react/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shhn0509.gitbook.io/react/til/curious-story/variable-shadowing.md).

# variable shadowing

variable shadowing은 외부에서 전달되어 들어오는 변수명과 내부에서 사용 되는 변수명과 같을 때 생기는 문제이다.&#x20;

그래서 Hook에서 외부에서 받아오는 `count`와 `number`의 변수 명을 다르게 해준다. 이 둘이 가리키는 값은 같다.&#x20;

![](/files/-MTdLNvbeeFYEOHb0ylw)
