Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jderochervlk/react-performance-example
https://github.com/jderochervlk/react-performance-example
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jderochervlk/react-performance-example
- Owner: jderochervlk
- Created: 2022-07-25T16:04:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-25T19:30:07.000Z (over 2 years ago)
- Last Synced: 2023-03-06T23:28:29.548Z (almost 2 years ago)
- Language: JavaScript
- Size: 69.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Performance Example
This is meant to be a minimal application to show the different between setting a state with plan JS objects, comparing the object before setting to state, and using Immutable.js to merge a new value into the old value before setting state.
## Running
```
yarn dev
```## Summary
- Avoid passing objects as props when possible
- When you do pass objects as props, make sure the object source doesn't change unless it needs to
- Using `_.isEquals` is good if you want to just use JavaScript objects
- `mergeDeep` is good if you want to use Immutable.JS