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

SnackbarProvider: prop type TransitionComponent is invalid #129

Closed
frafajec opened this issue Jun 8, 2019 · 2 comments
Closed

SnackbarProvider: prop type TransitionComponent is invalid #129

frafajec opened this issue Jun 8, 2019 · 2 comments

Comments

@frafajec
Copy link

frafajec commented Jun 8, 2019

Expected Behavior

No error should occur on <SnackbarProvider /> render.

Current Behavior

Error is thrown as soon as SnackbarProvider is rendered, complaining about the prop type definition. (note: functionality is not affected, just console spam)

Steps to Reproduce

I didn't manage to repro this on sandbox, Im not sure why. Build is completely fine, but this is output in the console:

Warning: Failed prop type: SnackbarProvider: prop type `TransitionComponent` is invalid; it must be a function, usually from the `prop-types` package, but received `undefined`.

I debugged a bit and found that TransitionComponent propType is: TransitionComponent: undefined, meaning propType passed doesn't exist.

Solution?

I changed in node_modules prop type for TransitionComponent to func, which then supplied propType and no complains from then on. Solution here: #130

Your Environment

Tech Version
Notistack v0.8.6
React v16.8.6
Browser Chrome 74
Typescript v3.4.5
@jhrinoa
Copy link
Contributor

jhrinoa commented Jun 17, 2019

This issue is actually happening on the demo link that's on the README page.

https://codesandbox.io/s/github/iamhosseindhv/notistack/tree/master/examples/simple-example??hidenavigation=1&module=%2FApp.js

I took a closer look, and found out what the root-cause is.
It looks like 15.6.2 prop-types version doesn't support elementType, and package.json still uses 15.6.2.
But the package-lock.json is using 15.7.2 which doesn't cause this issue.

So, if you use "yarn" to build your project, it will read in package.json and install 15.6.2 version of prop-types which doesn't support elementType.

I think we just need to update the package.json to have proper version as well. I wonder how the package.json and package-lock.json got out of sync.

@iamhosseindhv
Copy link
Owner

fixed in #134

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 a pull request may close this issue.

3 participants