A D3 blackbox higher order component – HOC
After the blackbox axis example above, you’d be right to think something like “Dude, that looks like it’s gonna get hella repetitive. Do I really have to do all that every time?”
Yes, you do. But! We can make it easier with a higher order component - a HOC.
Higher order components are one of the best ways to improve your React code. When you see more than a few components sharing similar code, it’s time for a HOC. In our case, that shared code would be:
- rendering an anchor element
- calling D3’s
Access this course and 1400+ top-rated courses and projects.