-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: introduce forbidUnknowProps #46
Conversation
There's a typo "forbidUnknowProps" (should be "forbidUnknownProps") in the documentation and code. Mind cleaning that up? |
I think that I don't like having a negative in the function name as it raises some questions about the parameters passed in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling errors and a comment about the chosen name of the function.
Maybe we should wait for this issue to be resolved (or help out): facebook/prop-types#263. It seems our use-case should be supported by I would prefer that over this solution. It's more standard, and others will understand easier what's going on. |
@ismay that issue has been open since March, you think it would be worth the wait? |
@varl function name has been corrected to |
I don't know what the holdup is. Depends if it'll need a ton more work or if it's nearly there. If it's close I'd prefer using the prop-types package over building and maintaining it ourself. That'll be easier for us and more clear for outside/new devs. |
The hold-up seems to be that |
That dude is fairly direct with closing PRs that are |
Closing this PR for the following reasons:
|
I introduced this component because
propTypes.exact
does something slightly different than we needed....For example this is how
propTypes.exact
is used:And this would be a similar example of how this new function
forbidUnknowProps
can be used:So with
forbidUnknowProps
we can wrap an entire prop-type definition and withexact
we operate at property level.As another note, normally we would export two "flavours": 1) the normal function and 2) the
isRequired
function. In this case that didn't make much sense....