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

Fix React.createFactory() crash #11484

Merged
merged 5 commits into from
Nov 8, 2017
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Nov 7, 2017

See commits. Standalone fix for this is being committed to www.

@clemmy
Copy link
Contributor

clemmy commented Nov 7, 2017

LGTM after prettier failure is addressed.

@@ -237,10 +237,9 @@ export function createElement(type, config, children) {
typeof props.$$typeof === 'undefined' ||
props.$$typeof !== REACT_ELEMENT_TYPE
) {
var displayName =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Isn't this weird though? I don't think I touched this code but now it wants me to reformat it.

it('should support React public API methods', () => {
expect(React.isValidElement(42)).toBe(false);
expect(React.isValidElement(<div />)).toBe(true);
expect(React.cloneElement(<div />, {foo: 42})).toEqual(<div foo={42} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. Cool that loose equality works out this way!

@gaearon gaearon merged commit c932885 into facebook:master Nov 8, 2017
Ethan-Arrowood pushed a commit to Ethan-Arrowood/react that referenced this pull request Dec 8, 2017
* Add a failing test for createFactory in production

* Fix createFactory() in production

* Add more prod-only tests

* Fix prettier

* Run prettier 1.8.1
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.

None yet

4 participants