Skip to content

propTypes wrapped with PropTypes.exact triggers react/prop-types rule #1575

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

Closed
vkartaviy opened this issue Nov 29, 2017 · 6 comments
Closed

Comments

@vkartaviy
Copy link

As PropTypes.exact was added facebook/prop-types@9057907 it would be great if plugin support it as well.

@ljharb
Copy link
Member

ljharb commented Nov 29, 2017

You can specify PropTypes.exact in propWrapperFunctions, but we should handle this by default.

@dustinsoftware
Copy link
Contributor

I can take a stab at implementing this one

@dustinsoftware
Copy link
Contributor

I'm running into an issue testing this - PropTypes.exact does not seem to work as expected when wrapping the proptypes object, like forbidExtraProps does. Still investigating, but here's a repro.

https://codepen.io/dustinsoftware/pen/BmGWXM

@dustinsoftware
Copy link
Contributor

@ljharb can you take a look at the pen I linked to? I see you've commented on a few related issues in the prop-types repo, it appears that PropTypes.exact currently can't be used as a wrapper for the whole props object.

@ljharb
Copy link
Member

ljharb commented Dec 17, 2017

@dustinsoftware Sorry for the delayed response. I think the current implementation in this plugin only allows a single identifier to be used; however, I would expect it to be enhanced to also support { property: "exact", object: "PropTypes" }.

@ljharb
Copy link
Member

ljharb commented Oct 12, 2021

This still seems to be an issue?

@ljharb ljharb reopened this Oct 12, 2021
@ljharb ljharb closed this as completed in 70dccbe Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants