https://github.com/lebinary/scan-react-dependencies
React hook's optimization tool
https://github.com/lebinary/scan-react-dependencies
Last synced: about 1 year ago
JSON representation
React hook's optimization tool
- Host: GitHub
- URL: https://github.com/lebinary/scan-react-dependencies
- Owner: lebinary
- Created: 2023-08-22T16:11:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T05:12:10.000Z (over 1 year ago)
- Last Synced: 2025-01-05T13:11:19.665Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UseEffect Scanner
## What does this do?
We all know it is not recommended to pass **an Object inside useEffect's dependency array**.
**Why?**\
Because React uses shallow comparison to determine if dependencies have changed. Objects are compared by reference, not by their content.\
This means that even if the object's contents haven't changed, React might treat it as a new dependency if it's recreated on each render.
**Solution:**\
This tool scan your files and returns those onjects that were passed in useEffect's dependency array.
## Getting started
### Install packages
Navigate to the project directory and run this in terminal
```bash
npm install
```
### Build the project
```bash
npm run build
```
### Start scanning for dependencies
```bash
npm run start -- "[Path to your file/directory]"
```