-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: Export missing type AnimationConfig
#2128
Conversation
Some open-source and largely used libraries such as nivo directly bind to the types being declared by `@react-pring/core` in some of their code. For instance in nivo, the following code: ```ts import { SpringValues } from '@react-spring/web' //... export interface NodeProps<Datum extends object> { //... animatedProps: SpringValues<NodeAnimatedProps> //... } ``` Implicitely force nivo to be able to reference parts of the typings of `@react-spring/core` into their d.ts files if they want to be able to publish their package. It basiaclly results into `Partial<import("@react-spring/core").AnimationConfig>` in the produced d.ts at some point. And as a consequence TypeScript complains with the error `error TS4023: Exported variable 'htmlDefaultProps' has or is using name 'AnimationConfig' from external module "/tmp/9a4cf066/node_modules/@react-spring/core/dist/index" but cannot be named.`. The proposed change exposes `AnimationConfig` as a type, meaning we still don't expose the class, just its type. It would help into making nivo able to support recent version of `@react-spring/*`. See related issue on nivo's side: plouc/nivo#2280
🦋 Changeset detectedLatest commit: e578cbe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 thanks for the contribution, cool library!
No it's not you, i need to remove the sandbox CI. |
Thank you so much for the quick approval and merge. And of course for this awesome library 👍 |
Hey @joshuaellis, Just wondering, any plan to do a release with this patch? |
Sorry i've been away, this has now been released! :) |
Thank you so much |
Some open-source and largely used libraries such as nivo directly bind to the types being declared by
@react-pring/core
in some of their code.For instance in nivo, the following code:
Implicitely force nivo to be able to reference parts of the typings of
@react-spring/core
into their d.ts files if they want to be able to publish their package. It basiaclly results intoPartial<import("@react-spring/core").AnimationConfig>
in the produced d.ts at some point. And as a consequence TypeScript complains with the errorerror TS4023: Exported variable 'htmlDefaultProps' has or is using name 'AnimationConfig' from external module "/tmp/9a4cf066/node_modules/@react-spring/core/dist/index" but cannot be named.
.The proposed change exposes
AnimationConfig
as a type, meaning we still don't expose the class, just its type. It would help into making nivo able to support recent version of@react-spring/*
. See related issue on nivo's side: plouc/nivo#2280Why
What
Checklist