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

Added extra explanation for require() statements #2170

Merged
merged 2 commits into from
Sep 10, 2014
Merged

Added extra explanation for require() statements #2170

merged 2 commits into from
Sep 10, 2014

Conversation

heysamtexas
Copy link
Contributor

Just thought it would be nice to know how to use this using require() statements.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@@ -21,3 +21,5 @@ The add-ons below are in the development (unminified) version of React only:
- [`Perf`](perf.html), for measuring performance and giving you hint where to optimize.

To get the add-ons, use `react-with-addons.js` (and its minified counterpart) rather than the common `react.js`.

If using require in node, then use `require('react/addons')`.
Copy link
Member

Choose a reason for hiding this comment

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

We do mention it super briefly in the npm readme, but it's not obvious. So let's do it. I'd like to tweak the wording though (you have to use require in Node, so there's no if about it).

Maybe something along the lines of this?

When using the react package in from npm, you can simply require('react/addons') instead of require('react') to get React with all of the addons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 sounds good. Let's go with that

Copy link
Member

Choose a reason for hiding this comment

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

Excellent. Want to update this PR or would you prefer I just add it in? (no need for me to steal credit, it was your idea!)

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

zpao added a commit that referenced this pull request Sep 10, 2014
Added extra explanation for require() statements
@zpao zpao merged commit 76d6481 into facebook:master Sep 10, 2014
@heysamtexas heysamtexas deleted the patch-1 branch September 12, 2014 14:29
zpao added a commit that referenced this pull request Sep 24, 2014
Added extra explanation for require() statements
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