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

Doesn’t work with React.createFactory() #277

Closed
gaearon opened this issue May 2, 2016 · 6 comments
Closed

Doesn’t work with React.createFactory() #277

gaearon opened this issue May 2, 2016 · 6 comments
Labels

Comments

@gaearon
Copy link
Owner

gaearon commented May 2, 2016

The issue is explained here: #276 (comment). It seems like we’d need to monkeypatch React.createFactory because it bypasses React.createElement and uses the internal ReactElement module directly.

@nfcampos
Copy link
Collaborator

nfcampos commented May 2, 2016

theres no need to patch React.DOM.* beause we only care about composite components right?

@gaearon
Copy link
Owner Author

gaearon commented May 2, 2016

Haha, excellent point! I’m being silly.

@gaearon gaearon changed the title Doesn’t work with React.createFactory() or React.DOM.* factories Doesn’t work with React.createFactory() May 2, 2016
@nfcampos
Copy link
Collaborator

nfcampos commented May 2, 2016

:) also, how about patching only the internal react/lib/ReactElement? surely they all import createElement from that one no?

@gaearon
Copy link
Owner Author

gaearon commented May 2, 2016

We could do this. It wouldn’t work in the future though when React ships flat bundles. Also doesn’t work for people who use precompiled builds of React. (Not sure we really want to support it, but right now we do.)

@nfcampos
Copy link
Collaborator

nfcampos commented May 2, 2016

I've added the failing test case for this on #278

@gaearon
Copy link
Owner Author

gaearon commented May 5, 2016

Fixed in 3.0.0-beta.2.

@gaearon gaearon closed this as completed May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants