Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error in axis types after update to 0.69.0 #1500

Closed
petrvecera opened this issue May 1, 2021 · 0 comments · Fixed by #1502
Closed

Typescript error in axis types after update to 0.69.0 #1500

petrvecera opened this issue May 1, 2021 · 0 comments · Fixed by #1502

Comments

@petrvecera
Copy link

petrvecera commented May 1, 2021

Describe/explain the bug
After the update to version 0.69 from version 0.68 the axisBottom (axis in general) definitions are no longer valid as per typescript.

Before update you could have:

      axisBottom={{
        tickSize: 5,
        tickPadding: 5,
        tickRotation: 0,
        legendPosition: "middle",
        legendOffset: 32,
      }}

Which is exact definition as generated by https://nivo.rocks/bar/

But after update it "wants" additional values:

axis: "x",
scale: "",
length: 20,
ticksPosition: 'before'

image

Could be related too f11d034 but frankly, I have no idea... https://github.com/plouc/nivo/blame/master/packages/axes/src/types.ts

To Reproduce
See the warnings in this code sample https://codesandbox.io/s/react-typescript-playground-forked-342ti?file=/src/index.tsx (wait for linter/typescript to load)
image

Expected behavior
The extra values are not necessary for defying the axisLeft/Right/Bottom etc

Versions
Looks like 0.68 is OK, and issue is reproducible only with 0.69

Tested locally with:

  • react 17.0.1,
  • typescript 4.1.5

PS: Thank you very much for keeping the project alive and releasing new versions!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants