using-react-hooks-with-d3
using-react-hooks-with-d3 copied to clipboard
Typescript
Hey
I've been enjoying your videos, I wanted to learn about d3 and need to build a racing bar chart so great!
I'm having some problems converting your code into Typescript, using @types/d3. Generally it's OK with things like NumberValue expected rather than Number or String. But I'm having trouble with the call function here
svg.select('.x-axis').style('transform', translateY(${dimensions.height}px)).call(xAxis);
Argument of type 'Axis<NumberValue>' is not assignable to parameter of type '(selection: Selection<BaseType, unknown, null, undefined>, ...args: any[]) => void'.
Are you thinking about adding Typescript versions as well at any stage, so I can look at them as I convert?
Thanks
Tom