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

Use React.createFactory in examples/basic/ #2344

Merged
merged 2 commits into from
Oct 15, 2014
Merged

Use React.createFactory in examples/basic/ #2344

merged 2 commits into from
Oct 15, 2014

Conversation

ThomasCrevoisier
Copy link
Contributor

See #2315

Reviewers: @zpao @spicyj @syranide

@syranide
Copy link
Contributor

The preferred approach is to use var ExampleApplication = React.createFactory(...); and then ExampleApplication(...) I believe, React.createElement is not generally intended for the end-user.

@syranide
Copy link
Contributor

Oh, I just saw #2315... @zpao shouldn't they use React.createFactory instead?

@zpao
Copy link
Member

zpao commented Oct 14, 2014

Oh yea, I suppose they should. I was thinking about the general case of just putting in what the JSX got transformed to, but showing the normal approach is a good idea. Let's do that.

Also, nits: let's use //-style comments, and not put them inside the function call. Make the comment when calling createFactory.

@ThomasCrevoisier
Copy link
Contributor Author

Okay, I've made the change.

@zpao zpao changed the title Use react.createElement in example in basic/ according to #2315 Use React.createFactory in examples/basic/ Oct 15, 2014
@zpao
Copy link
Member

zpao commented Oct 15, 2014

I really appreciate this. I may end up tweaking this a little bit as I do a more general update to the examples.

zpao added a commit that referenced this pull request Oct 15, 2014
Use React.createFactory in examples/basic/
@zpao zpao merged commit bc672c8 into facebook:master Oct 15, 2014
@syranide
Copy link
Contributor

Thanks! 👍

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.

3 participants