Set up D3.js Inside React in 5 Minutes
Adil Baaj
1094

Hey, great article. A couple of things to consider. The 4.0 version of D3 is now broken into ES6 modules and you can just import the pieces that you need. You can see a list of the Es6 modules here…

https://github.com/d3/d3/blob/master/API.md

One approach for React is that you can just use the D3 layout algorithms, scales, etc to get your coordinates and geometry, but let React control what’s in the DOM. The 4.0 modules also avoid mutating your data which has been another issue with D3 and the whole React/Redux/Don’t-Mutate-The-State paradigm that’s all the rage these days. I put together some prototypes here to show the idea in repo here…

https://github.com/sghall/react-d3-transitions