joshwnj / joshwnj/react-visibility-sensor
Modernise codebase discussion
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 192
- PR merge metrics
- No merged PRs in 30d
Description
Looking to kickstart some discussion around modernising the code base and future features
- [ ] Switch to ES6 classes instead of `create-react-class` - much easier for newcomers to React to understand the code with this, plus it's increasingly the _recommended_ way across the ecosystem
- [ ] Switch to ES6 for the codebase - (this isn't a lot actually, mostly var -> `let/const`, arrow functions etc)
- [ ] Use the `setState(fn)` form rather than the `setState(obj)` form in anticipation of priorities in fiber
- [ ] Figure out build process if using ES6 (rollup/webpack + babel)
- [ ] Add support for `requestAnimationFrame` for high performance scroll listeners
- [ ] Support passive event listeners for better perf
- [ ] In modern browsers with Intersection Observer support, use that instead of JS calculations (eventually over time this lib should become a wrapper around that w/ polyfill for older browsers?)
- [ ] More "functional" API (refer https://github.com/joshwnj/react-visibility-sensor/issues/74)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.