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

Remove React.createFactory call on new React versions since React thr… #11

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

rikukissa
Copy link
Contributor

…ows warning about no render method defined when component is wrapped with createFactory

Warning: Component(...): No render method found on the returned component instance: you may have forgotten to define render in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.

…ows warning about no render method defined when component is wrapped with createFactory

Warning: Component(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.
@quantizor
Copy link
Contributor

@rikukissa 100% sure about that? When I was testing it earlier the rendering didn't work without that...

@dandelany
Copy link

React.createFactory is a necessary wrapper for those not using JSX - however, the module consumer should be responsible for calling createFactory if they need to. Otherwise those using JSX will run into problems. Per Facebook, exporting factories is an anti-pattern that should be avoided, the class should be exported instead.

@rikukissa
Copy link
Contributor Author

Yeah, when used without JSX everything surely works fine with createFactory, but with JSX you'll get the error I mentioned earlier. So it would probably be logical to export the barebones version of the component and let non-JSX users wrap the component with createFactory

quantizor pushed a commit that referenced this pull request Sep 21, 2015
Remove React.createFactory call on new React versions since React thr…
@quantizor quantizor merged commit 38a876b into enigma-io:master Sep 21, 2015
@quantizor
Copy link
Contributor

Thank you!

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.

None yet

3 participants