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

fix(bar): avoid to redefine react forwardRef type #1793

Merged

Conversation

adriengibrat
Copy link

Avoid to redefine react type ;)

The previous definition was problematic when using proptypes in a typescript file:

Any typescript codebase importing @nivo/bar suddendly can't attach propTypes to the returned value of forwardRef because they are now just a function and not a ForwardRefExoticComponent anymore... unexpected & very disturbing.

This resulted in breaking build with typescript errors!

The symptomatic error is ts(2339):

Property 'propTypes' does not exist on type '(props: ...) => ReactElement<...> | null'.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b901f40:

Sandbox Source
nivo Configuration

@plouc
Copy link
Owner

plouc commented Dec 17, 2021

Thank you @adriengibrat!

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

Successfully merging this pull request may close these issues.

None yet

2 participants