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

Prop types report missing prop since v3.0.0 #57

Closed
dan-lee opened this issue Jul 28, 2018 · 3 comments
Closed

Prop types report missing prop since v3.0.0 #57

dan-lee opened this issue Jul 28, 2018 · 3 comments

Comments

@dan-lee
Copy link

dan-lee commented Jul 28, 2018

Since the latest version I get the misleading warning from PropTypes despite the prop is being provided:

Warning: Failed prop type: The prop xxx is marked as required in Foo, but its value is undefined.

Compare the same code with different versions in CodeSandbox and check the console:

Locally I tried to revert this line:

const objectPrototype = Object.prototype;

Back to this:

var objectPrototype = getPrototypeOf && getPrototypeOf(Object);

And it seemed to work again. I am not sure what's happening there and I did not investegate further, just wanted to share some insights.

@mridgway
Copy link
Owner

Ah, I see what's happening here. It has to do with how we detect the type of components here: https://github.com/mridgway/hoist-non-react-statics/blob/master/src/index.js#L60. I will follow up on this with a fix.

@mridgway
Copy link
Owner

This should be fixed in v3.0.1.

@dan-lee
Copy link
Author

dan-lee commented Jul 30, 2018

Thanks for the quick resolution

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

No branches or pull requests

2 participants