Skip to content

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.

2 participants