Re:React and D3.js
by ironmagma on Tuesday March 30, 2021 @06:00AM
(#26632817)
Normally, if you are writing something so weird that it needs to be imperative to be readable or work right, you can just do that inside a useEffect, or at least encapsulate it in a component. For most animations, ReactCSSTransitionGroup is sufficient. This is an interesting case study only because D3 is particular about wanting data to be stored in the DOM, and React is particular about wanting the data to be stored anywhere but the DOM. I am curious though what you mean by dirty refs?
[ Parent
| on HN ]
Re:React and D3.js
by darepublic on Tuesday March 30, 2021 @11:25AM
(#26635683)
> what you mean by dirty refs?
oh I guess that is confusing, I just meant to invoke the attitude of react purists to using refs (like in the article), although imo it is sometimes the best and 'cleanest' way of expressing what you want to do