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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/09-addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!)