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

Add Jest unit tests #4

Open
davidnmora opened this issue Mar 29, 2021 · 1 comment
Open

Add Jest unit tests #4

davidnmora opened this issue Mar 29, 2021 · 1 comment

Comments

@davidnmora
Copy link
Owner

No description provided.

@davidnmora
Copy link
Owner Author

One potential challenge to test:

React can still rerender the component instance using useD3AttrTransition during animation. When a parent component renders the children will be rendered too and this can happen during the animation. shouldComponentUpdate won't guard against that since Context updates can skip shouldComponentUpdate() = false component.

I would safeguard against it by returning partially modified (halfway through animation) attributes from useD3Transition if it happens. This way if React rerenders halfway through animation for any reason, it will still work

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

No branches or pull requests

1 participant