1465 Commits

Author SHA1 Message Date
Dan Abramov 24e698a93b Reword animation documentation deprecation (#9957) 2017-06-14 14:01:46 +01:00
Dan Abramov 66b42830e0 Fix doc styling and formatting issues 2017-06-12 16:33:42 -07:00
Mario Souto f931ad7d25 Remove extra brace (#9910) 2017-06-12 16:33:42 -07:00
Kurt Furbush debf4f85e6 Update reference-react-component.md (#9863)
Grammatical edit to match same statement in state-and-lifecycle.html
2017-06-12 16:33:42 -07:00
Garmash Nikolay 6bef36d9fa Fix url to ng-animate (#9859) 2017-06-12 16:33:41 -07:00
Fernando Montoya a5e0067358 Update webpack according to brand guidelines (#9595)
* Update webpack according to brand guidelines

* Change all ocurrences to webpack
2017-06-12 16:33:41 -07:00
Ricardo b0777a695a Insert blockquote on prop value explanation. (#9770)
While reading the page, the "chain of thought" is broken by stating that the `tempertature` and `onTemperatureChange` don't have any special meaning. Making this a blockquote makes that note look more like a comment and keep the "chain of thought" intact.
2017-06-12 16:33:41 -07:00
cjshawMIT eec984d80d Clarifying how to apply aria-* attributes (#9843)
Provide explicit example of what "keep lowercase" means for `aria-*` attributes.
2017-06-12 16:33:41 -07:00
Lipis b77fd87b52 Rename Javascript to JavaScript (#9796) 2017-06-12 16:33:41 -07:00
Flarnie Marchan 9d60d38abe Add 'Test Utils' docs back to main navigation (#9676)
* Add 'Test Utils' docs back to main navigation

**why make this change?:**
We accidentally removed this - still supporting the use of Test Utilities, so we should have them in the docs.

**test plan:**
Manually tested the website - will insert a screenshot.

**issue:**
https://github.com/facebook/react/issues/9651

* Move test-utils docs to reference section

**what is the change?:**
Moved from 'advanced guides' to 'reference'

**why make this change?:**
It makes more sense as a reference

**test plan:**
Visual inspection (flarnie may add a screenshot)

**issue:**

* Add back the shallow renderer docs and remove outdated docs

**what is the change?:**
- Remove outdated 'shallow renderer' docs on 'test utils' page, and point to the updated 'shallow renderer' docs.
- Re-add a link to the updated 'shallow renderer' docs on the main navigation.

**why make this change?:**
This was already approved in https://github.com/facebook/react/pull/9331 which was then cherry-picked to https://github.com/facebook/react/pull/9359/commits and landed on master.

I'm not sure why some of these changes didn't persist. For now just adding back the changes we need.

**test plan:**
Manually inspected website - will insert screenshots.

**issue:**

* Further improvements to 'shallow rendering' and 'test utils' docs

Thanks @gaearon for the improvements!

**what is the change?:**
- Remove <hr/> from end of 'shallow rendering' docs
- 'documents' -> 'documentation'
- Move 'shallow rendering' redirection section to top of 'test utils' docs
- Add intro sentence about testing to 'shallow rendering' docs

**why make this change?:**
Documentation helps people learn.

**test plan:**
Visual inspection

(cherry picked from commit 114b9c5500)
2017-06-12 16:33:41 -07:00
Max Donchenko 88815d6eeb Fix typo (#9786)
(cherry picked from commit 43f2ea079c)
2017-06-12 16:33:41 -07:00
Danny Hurlburt 1a663a4a3f Bind handleChange Instead of Calling (#9764)
(cherry picked from commit 1f667fd37f)
2017-06-12 16:33:41 -07:00
Dave Lunny 80252af027 "Timeline" => "Performance" (#9602)
As of Chrome 58, the Timeline tab is now called the Performance tab, this updates the "Optimizing Performance > Profiling Components with Chrome Performance" section of the docs to reflect that.
(cherry picked from commit 5cf571839e)
2017-06-12 16:33:41 -07:00
shifengchen 9a2ddbddc9 Edit two errors in docs (#9659)
(cherry picked from commit d7e6ef0f88)
2017-06-12 16:33:41 -07:00
Dan Abramov 18eff07423 Fix horizontal scrolling in docs (#9613)
(cherry picked from commit 6facb85f85)
2017-06-12 16:33:40 -07:00
Dan Abramov 3b7a6c8b56 Fix mobile layout 2017-06-12 16:33:40 -07:00
Dan Abramov aef13f093d Fix a typo 2017-06-12 16:33:40 -07:00
Dan Abramov 5458982197 Use a more specific link 2017-06-12 16:33:40 -07:00
Addy Osmani 3300ecb48a Add DEV mode note to installation doc (#8784) (#9157)
* Add DEV mode note to installation doc (#8784)

* Address feedback from Dan on wording

(cherry picked from commit f86256ece0)
2017-06-12 16:33:40 -07:00
Dan Abramov bf4af51c99 Add more info about building for production (#9592)
* Add more info about building for production

* Add more info to the docs

(cherry picked from commit 185db64c76)
2017-06-12 16:33:40 -07:00
Marcos Ojeda 2413107b1d docs better indicate that state updaters shallowly merge with state (#9554)
this was a surprise to me because the docs seemed to indicate that when
using an updater, the result _needed_ to be a new state object. I was
[not alone](https://twitter.com/ken_wheeler/status/857939690191806464)
i think in discovering this as a result of the previous tweet in the
thread.
(cherry picked from commit f737d63302)
2017-06-12 16:33:40 -07:00
wacii edd83dd8fc Add guide on integrating with non-react code (#9316)
* Add guide on integrating with non-react code

* Capitalize guide title

* Make links to other docs relative

* Rephrase 'What it does do'

* Remove experimental syntax

* Capitalize Backbone

* Remove empty lifecycle method in generic jQuery example

* Use shouldComponentUpdate() not componentWillUpdate()

* Prefer single quotes

* Add cleanup to generic jQuery example

* Capitalize React

* Generalize the section on Backbone Views

* Generalize the section on Backbone Models, a little

* Add introduction

* Adjust wording

* Simplify ref callbacks

* Fix typo in generic jQuery example

* Fix typos in Backbone models in React components

* Fix more typos in Backbone models in React components

* Add generic section on integrating with other view libraries

* Stress the benefits of an unchanging React element

* Small changes to introduction

* Add missing semicolon

* Revise generic jQuery wrapper section

Moved the section on using empty elements to prevent conflicts above the
code example and added brief introduction to that example.

* Add usage example for Chosen wrapper

* Prevent Chosen wrapper from updating

* Note that sharing the DOM with plugins is not recommended

* Mention how React is used at Facebook

* Mention React event system in template rendering section

* Remove destructuring from function parameters

* Do not name React components Component

* Elaborate on unmountComponentAtNode()

* Mention preference for unidirectional data flow

* Rename backboneModelAdapter

* Replace rest syntax

* Respond to updated model in connectToBackboneModel

* Rewrite connectToBackboneModel example

* Rework connectToBackboneModel example

* Misc changes

* Misc changes

* Change wording

* Tweak some parts

(cherry picked from commit 1816d06d6b)
2017-06-12 16:33:40 -07:00
chocolateboy fc33c50020 [Docs] Fix confusing description for the <script>...</script> usage (#9502)
* Fix confusing description for the <script>...</script> usage

* Update jsx-in-depth.md

* Update reference-react-dom-server.md

* Update reference-react-dom.md

* Update reference-react.md

(cherry picked from commit 3d60d4cc7d)
2017-06-12 16:33:39 -07:00
Dmitri Zaitsev 4ad20dbf00 Add reference to the Hyperscript libraries (#9517)
* Add reference to the Hyperscript libraries

I feel these should be mentioned as they provide terser syntax than using `R.createElement` directly, even with a shorthand.

* Rephrase

(cherry picked from commit a8c223ab41)
2017-06-12 16:33:39 -07:00
Frankie Bagnardi e85ec2f735 adds indirect refs to docs (#9528)
* adds indirect refs to docs

* Add more info

* Explain clearer

* Rephrase

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

* Update refs-and-the-dom.md

(cherry picked from commit 14fa8a5452)
2017-06-12 16:33:39 -07:00
David Hu 7723dc4a39 Add more details in jsx-in-depth.md (#9006)
* jsx-in-depth.md add ternary statement for javascript expressions section

* jsx-in-depth.md add explanation to get falsey values for props

* update jsx-in-depth.md

* ensure links work locally, remove section about falsey prop values

* Fix links
2017-06-12 16:33:39 -07:00
Almero Steyn 11d2471640 [Docs: Installation] Fix tabs responsive layout - Resubmit (#9458)
* [Docs: Installation] Fix tabs responsive layout

* Move tabs a pixel down

* Remove left margin on first tab

* Remove the long line

* Fix mobile styles

(cherry picked from commit a92128e7fb)
2017-06-12 16:33:39 -07:00
Almero Steyn a7524ab0dd [Docs] Add accessibility to tabs in installation documentation (#9431)
* Add accessibility to tabs in installation documentation

* Change color and fix styling

(cherry picked from commit 9526174e30)
2017-06-12 16:33:39 -07:00
Filip Hoško 4b577eb731 FIX: Move CRA build info under it's tab page (#9452)
* FIX: Move CRA build info under it's tab page

* Add some links
2017-06-12 16:33:39 -07:00
Jayen Ashar 8b71e9fced Update jsx-in-depth.md (#9178)
* Update jsx-in-depth.md

Line 9 isn't changed

* Move selection down

* Fix

(cherry picked from commit ccb38a96cf)
2017-06-12 16:33:39 -07:00
Fraser Haer a6102842ac Unique headings for linking purposes (#9259)
Previously two headings were 'Javascript Expressions' - now 'Javascript
Expressions as Props' and 'Javascript Expressions as Children'
(cherry picked from commit 363f6cb2e5)
2017-06-12 16:33:39 -07:00
NE-SmallTown 97542e7a99 [Documentation] Impreove the react-component section of doc (#9349)
* Impreove react-component of doc

[#9304](https://github.com/facebook/react/issues/9304)

* update description

* add missing space

(cherry picked from commit 359f5d276f)
2017-06-12 16:33:39 -07:00
Dan Abramov 7bdf33b2c5 Switch Installation to a tab when hash is present (#9422) 2017-06-12 16:33:38 -07:00
hanumanthan dda27a3515 Refractor docs to indicate that state set to props in constructor will not recieve the updated props (#9404) 2017-06-12 16:33:38 -07:00
Marks Polakovs bed4e33259 Add tabs to installation page (#9275, #9277) (#9401)
* Add tabs to installation page (#9275, #9277)

This adds tabs for create-react-app and existing apps to the installation section of the docs. The tab implementation is a simplified version of React Native's installation page.

Fixes #9275.

* Use classList instead of className

* Use same implementation as in RN
2017-06-12 16:33:38 -07:00
Eric Elliott 6a095209fe Docs: Clarification of setState() behavior (#9329)
* Clarification of setState() behavior

`setState()` is a frequent source of confusion for people new to React, and I believe part of that is due to minimization of the impact of the asynchronous behavior of `setState()` in the documentation. This revision is an attempt to clarify that behavior. For motivation and justification, see [setState Gate](https://medium.com/javascript-scene/setstate-gate-abc10a9b2d82).

* Update reference-react-component.md

* Signature fix

* Update to address @acdlite concerns

* Add more details
2017-06-12 16:33:38 -07:00
Nathan Hunzaker 0001036d35 Move ReactDOMFactories into separate package (#8356)
- Update examples to no longer use React.DOM
- Add package and documentation entries for react-addons-dom-factories
- Update dom-factories readme
- Set up proxy to intercept React.DOM usage
- Update ReactDOM children tests to use createElement
- Add more specific warning assertion for React DOM factories
- Do not use expectDev in ReactDOMFactories tests
2017-05-09 13:51:22 +01:00
Dominic Gannaway e78b192e14 Update typechecking-with-proptypes.md (#9392)
* Update typechecking-with-proptypes.md

* Update typechecking-with-proptypes.md

* Use consistent style for PropTypes import
2017-04-12 00:05:11 +01:00
Denis Pismenny fd6eece6af Fix minor typo in lifting-state-up.md (#9408) 2017-04-11 22:06:30 +01:00
Dan Abramov 80b862395d Fixes for 15.5 addons (#9385)
* Add missing object-assign dep to create-react-class

* Remove unnecessary inlines and irrelevant tests in createFragment

* Uninline shallowEqual in shallowCompare

* Uninline invariant in update

* Uninline invariant/warning and remove unreachable code in react-linked-input

* Envify and collapse createClass UMD

* Envify and collapse createFragment

* ReactLink doesn't really need PropTypes dep

It is unnecessary because it is not explicitly exposed and was never public API.

* Rebuild, envify and collapse LinkedStateMixin UMD

* Collapse PureRenderMixin UMD

* Rebuild shallowCompare

* Envify and collapse update UMD

* Remove unused prop-types dep from linked-input

* Fix change handling in LinkedInput

* Compile LinkedInput to ES5

* Rebuild, collapse, and fix LinkedInput UMD

* Add full README for react-addons-create-fragment

* Mention compat version of transition-group so we can delete those docs

* README for react-addons-linked-state-mixin

* More docs

* Fix devDeps for createClass

* docs
2017-04-09 04:01:35 +01:00
Aaron Ackerman 129956a65d Point users to the npm page instead of the github project for prop-types (#9373) 2017-04-08 04:07:19 +01:00
Flarnie Marchan 4a3b790ce4 Update example snippet in old 'React.addons' doc page (#9363)
* Update example snippet in old 'React.addons' doc page

This makes the example more consistent.

* Add back the pointers in docs that were mistakenly removed

In https://github.com/facebook/react/pull/9359 we accidentally removed
pointers in some doc pages. Putting them back now.

* Link to npm package instead of github page

This seems like a more stable place to link to in the 'context'
document.
Based on @bvaughn's feedback in https://github.com/facebook/react/pull/9359
2017-04-07 14:13:53 -07:00
Flarnie Marchan 0420e96a41 All doc updates forv15.5 (#9359)
* `react-addons-test-utils` -> `react-dom/test-utils`

Updating all references and docs on the `React.addons.TestUtils` and the
shallow renderer to refer to the correct targets.

Instead of:
```
const React = require('react');

// ...
React.addons.Testutils
// or

const ReactTestUtils = require('react-addons-test-utils');
```
we now show:
```
const ReactTestUtils = require('react-dom/test-utils');
```

And for shallow renderer, instead of:
```
const shallowRenderer = TestUtils.createRenderer();
```

we now show:
```
const shallowRenderer = require('react-test-renderer/shallow');
```

* Update the 'prev' and 'next' attributes of 'add-ons' docs

These flags are used to set arrow links to easily navigate through the
documents. They were wrong or missing in some of the 'add-ons' pages and
this bothered me when manually testing the updates from the previous
commit.

* Update syntax for instantiating shallow renderer

Missed this when updating the docs for the changes to shallow-renderer
in React 15.5.

* Fix pointers in addons docs

Thanks @bvaughn for catching this

* Make example of shallow renderer more consistent

We should show using the same variable names between code samples.

* Make names in example even more consistent

We should use the same variable name for the same thing across examples.
`renderer` -> `shallowRenderer`.

* Update docs to deprecate React<CSS>TransitionGroup

 - removes link to the docs about `ReactCSSTransitionGroup` and
   `ReactTransitionGroup` from the main navigation
 - updates 'prev' and 'next' pointers to skip this page
 - adds deprecation warning to the top of the page
 - remove references to these modules from the packages README
 - updates 'add-ons' main page to list this as a deprecated add-on

* Update `React.createClass` to `createReactClass` in the docs

The `React.createClass` method is being deprecated in favor of
`createReactClass`.

* Remove 'React.createClass' from top level API docs

It no longer makes sense to have a section for the 'createClass' method
in this page, since it won't be available as a top level method on
'React'.

I initially was going to pull the section about 'createClass' into a
separate page to add under 'addons' but it was short and duplicative of
the 'react-without-es6' docs. So I just linked to those.

* Remove *most* `React.PropTypes` from the docs

I am doing the docs for `context` in a separate commit because that case
was a bit less clear-cut.

We will no longer support `React.PropTypes` as a built-in feature of
React, and instead should direct folks to use the `PropTypes` project
that stands alone.

Rather than retaining the `React.PropTypes` examples and just revamping
them to show the use of the stand-alone `PropTypes` library with React,
it makes more sense to direct people to that project and reduce the
perceived API area and complexity of React core. The proper place to
document `PropTypes` is in the README or docs of that project, not in
React docs.

* Update `context` docs to not use `React.PropTypes`

We use `React.PropTypes` to define the `contextType` for the `context`
feature of React. It's unclear how this will work once `React.PropTypes`
is replaced by the external `PropTypes` library. Some options;

a) Deprecate `context`, either in v16 or shortly after. Seems reasonable
based on the intense warnings against using context that we have in the
docs -
https://facebook.github.io/react/docs/context.html#why-not-to-use-context
**Except** that probably some widely used libraries depend on it, like
`React-Router`.

b) Expect users will use external `PropTypes` library when defining
`contextTypes` and just don't do our `checkReactTypeSpec` against them
any more in v16.

c) Stop masking context and pass the whole context
unmasked everywhere. Worst option, do not recommend.

I went with `b` and assume that, for now, we will get users to use the
external `PropTypes` when defining context. I will update this PR if we
want a different approach.

* Remove 'addons' items from left nav, and deprecate 'addons' doc page

The plan:
[X] Remove links to 'addons' items from main navigation
[X] Add deprecation notices where appropriate, and update syntax to show
using the separate modules.
[ ] Update other references to 'React.addons' in docs. Coming in next
commit.
--- blocked but coming in future PRs
[ ] Link to a blog post describing the new locations of add-ons in the
deprecation notice on the '/docs/addons.html' page. Blocked until we
actually publish that blog post.
[ ] Move the docs for each add-on to the actual github repo where it now
lives.
[ ] Redirect the old add-ons doc permalinks to the docs in the separate
github repos for those modules.
[ ] Remove the old add-ons doc markdown files from React core docs.

* Remove references to `React.addons` from docs

Just misc. places where we referenced the 'addons' feature. All gone!
2017-04-07 14:12:10 -07:00
Damian Nicholson 364d4a4ea1 Added semicolons to addons imports examples. (#9287) 2017-04-07 14:10:01 -07:00
Dan Abramov b3ec0cb488 Remove examples/ folder (#9323) 2017-04-07 14:05:17 -07:00
Aaron Cannon b596e0bcaa Make it clear that textarea also supports defaultValue. (#9318) 2017-04-07 14:04:03 -07:00
Johan Tinglöf e700f42138 Updated Router import for example (#9233)
Updated import in order to be a correct working example as in accordance with the docs
(cherry picked from commit 38d8f3ee6b)
2017-03-24 09:49:26 -05:00
CodinCat 7835fdcd21 Use single quotes, remove extra whitespace (#9215)
(cherry picked from commit 0ceb5115ac)
2017-03-24 09:49:25 -05:00
Dan Abramov 39ff5c4895 Reorder sections in alphabetical order (#9143)
* Reorder sections in alphabetical order

* Reorder here too

(cherry picked from commit 7fa311bcd9)
2017-03-09 20:47:20 +00:00
Dima Beznos c1ba5b2ddc Added Brunch build tool to the docs (#9074)
* Added Brunch build tool to the docs

* Improved grammar

* product build -> production build

(cherry picked from commit 0bedd0697a)
2017-03-09 20:44:06 +00:00