Skip to content

Conversation

jddxf
Copy link
Contributor

@jddxf jddxf commented Oct 31, 2016

We should test $$typeof field against REACT_ELEMENT_TYPE to check if something is a React Element.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Oct 31, 2016

Thanks for the PR but I believe the original is clearer. REACT_ELEMENT_TYPE is Symbol.for('react.element'). Cheers!

@gaearon gaearon closed this Oct 31, 2016
@jddxf
Copy link
Contributor Author

jddxf commented Oct 31, 2016

REACT_ELEMENT_TYPE is a plain number if there is no native Symbol nor polyfill.

@gaearon
Copy link
Collaborator

gaearon commented Oct 31, 2016

Right, but this is a fallback case and doesn't seem as important to document here to me.
Maybe could add "or a magic number as a fallback".

@jddxf
Copy link
Contributor Author

jddxf commented Oct 31, 2016

Got it. Then I'll just ignore it. Thanks.

@jddxf jddxf deleted the fix-docs-on-reactelement branch November 1, 2016 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants