-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
Conversation
LGTM after prettier failure is addressed. |
packages/react/src/ReactElement.js
Outdated
@@ -237,10 +237,9 @@ export function createElement(type, config, children) { | |||
typeof props.$$typeof === 'undefined' || | |||
props.$$typeof !== REACT_ELEMENT_TYPE | |||
) { | |||
var displayName = |
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.
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} />); |
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.
Huh. Cool that loose equality works out this way!
* Add a failing test for createFactory in production * Fix createFactory() in production * Add more prod-only tests * Fix prettier * Run prettier 1.8.1
See commits. Standalone fix for this is being committed to www.