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

Update PropTypes for ReactElement & ReactNode #2343

Merged
merged 1 commit into from
Oct 15, 2014

Conversation

zpao
Copy link
Member

@zpao zpao commented Oct 14, 2014

This updates the API to match our updated terminology, as well as bring us in line with our definition of a node. It does mean we're currently lying to people about renderables.

Reviewers: @sebmarkbage

Test Plan: npm run jest

@@ -65,6 +66,9 @@ var emptyFunction = require('emptyFunction');

var ANONYMOUS = '<<anonymous>>';

var elementTypeChecker = createElementTypeChecker();
var nodeTypeChecker = createRenderableTypeChecker();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be renamed createNodeTypeChecker?

@@ -277,10 +296,8 @@ function createShapeTypeChecker(shapeTypes) {
}

function isRenderable(propValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to isNode as well right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I suppose. isNode is technically a misnomer, though I guess even the {}s are technically nodes as they are defined today.

@zpao zpao added this to the 0.12 milestone Oct 14, 2014
@sebmarkbage
Copy link
Collaborator

Everything in PropTypes are value types or union/array types. These could be called React.PropTypes.ReactElement and React.PropTypes.ReactNode which is likely what they would be called in Flow. Not sure if we want to introduce that convention here or stick to lower-case?

@zpao
Copy link
Member Author

zpao commented Oct 15, 2014

Going to leave it as is.

zpao added a commit that referenced this pull request Oct 15, 2014
Update PropTypes for ReactElement & ReactNode
@zpao zpao merged commit 7853aff into facebook:master Oct 15, 2014
zpao added a commit that referenced this pull request Oct 29, 2014
This should have gone in as a part of #2343
@zpao zpao deleted the proptypes-deprecation branch October 30, 2014 01:07
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.

3 participants