Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate bjbrewster rerender fixes #1

Open
wants to merge 6 commits into
base: rerender-fixes
Choose a base branch
from

Conversation

inactivist
Copy link
Owner

@inactivist inactivist commented Dec 8, 2022

Fix various component rerender issues. See Martin36#81

- Extracted util methods to allow mocking for tests
- Include single lodash methods instead of all to reduce bundle size
- Add initial component test
- Added snapshot test for future changes
- Replaced useDeepCompareEffect with simpler version using JSON.stringify
  It should have been !isDeepEqual and not include callback in deps.
- Added fixed width/height in test for snapshots.
- selectedRef was used incorrectly.
- iniChart no longer recreated each render. I will extract to utils next.
- No longer re-inits every render due to props object changed.
- Removed re-render on resize. Not required when using relative viewbox coords.
- Moved arcChart and pieChart generators into renderChart. Recreate when used.
- Fix calling renderChart twice on first render
- Change setArcData to getArcData
- Removed unrequired refs
- Greatly optimised calculation
- renderChart() will be split into create/update arc and needle and only
  called when props changed
div html elements already have width 100% as they are display: block by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants