near-explorer
near-explorer copied to clipboard
refactor(frontend): Clean up warnings in StrictMode
Story
The warnings are potential bugs, so we should resolve them whenever possible.
Enabling StrictMode in next.config.js reveals that:
- [ ] FlipMove and InfiniteScroll use
UNSAFE_componentWillReceiveProps
: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. - [ ] FlipMove: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of _default which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node
NOTE: We may want to try https://github.com/CassetteRocks/react-infinite-scroller instead of react-infinite-scroll-component
Acceptance Criteria
- [ ] All the warnings are resolved
- [ ] Pagination (infinite scrolling) works
- [ ] Animations (flip move) work