-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Conversation
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')`. |
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.
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 simplyrequire('react/addons')
instead ofrequire('react')
to getReact
with all of the addons.
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.
👍 sounds good. Let's go with that
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.
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!)
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Added extra explanation for require() statements
Added extra explanation for require() statements
Just thought it would be nice to know how to use this using require() statements.