News for hackers. Stuff that matters.
Re:React and D3.js by gherkinnn on Tuesday March 30, 2021 @05:25AM (#26632606)
JSX allows your version too.

     <Circle draw={[150, 77, 40]} />
It's a bit hideous, yes. But it illustrates the point: most people prefer what are effectively named parameters.

    // alternative interface
    <Circle draw={{ cx: 150, cy: 77, r: 40 }} />
Since all three are of the same type and potentially within the same order of magnitude, there's no way to discern what the values represent.

In any case, you're free to pass an entire collection at once:

    // individual props
    <Circle {...props} />

    // pass all options in one prop
    <Circle draw={props} />

There are no comments on this comment yet.