New types and TypeScript test for Pie component #216
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #215
The original theme prop was copied from the Bar component's .d.ts, it also have the same problems and is not resolved by this PR. These common types (theme, motion legends etc.) should all actually be defined in the @nivo/core package and imported. So the next step would for sure be to create the @nive/core .d.ts and then components after that.
Again he motion props are copied from the bar defs but should be refined and moved to core package.
I crated the theme types from the default theme props in core, when moved/implmented in to core this should probably be reworked and make sure all props are there. But for pie this should be enough?
I also added a types folder and a test .tsx files. I think this is good practice, a types folder can contain more types files if needed for a more complex component, and even local tsconfig.json files or lint.
Even if the pie is simple its nice to keep it consistent.