2286 Commits

Author SHA1 Message Date
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
Dan Abramov 7dbf2b348c Bump React version on doc website 2017-04-08 04:11:04 +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
Andrew Clark 245ea0c358 Blog post and changelog for 15.5.0 (#9368) 2017-04-07 14:46:29 -07:00
Andrew Clark c54ad571e5 Update React version in docs 2017-04-07 14:35:00 -07: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
najisawas 7a11c572e6 Fixed typo on implementation notes page (#9258)
Added paren to "mountComponent()" for consistency
2017-04-07 14:06:58 -07:00
Giorgio Polvara 9b4d42ca64 Fix typo (#7953) 2017-04-07 14:06:36 -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
Justin b9f9b3cce6 Fix grammar typo in Design Principles docs (#9324)
features → feature
> There is nothing "bad" about using state or lifecycle hooks in components. Like any powerful feature**s**, they should be used in moderation, but we have no intention to remove them.

I can’t explain the exact grammatical principle this violates, but it sounds wrong to my native English ears that “feature” is plural here. Another way to check if the grammar sounds right is to change the order of the clauses: ”They should be used in moderation, like any powerful feature“ sounds right, whereas “They should be used in moderation, like any powerful features” does not.
2017-04-07 14:03:46 -07:00
Dan Abramov c549c8b66e Update build paths in docs (#9340) 2017-04-07 14:03:09 -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
Bernard Lin 5232246116 Conferences (#9234)
* standard format for React Rally

* move React Conf 2017 to past conferences

(cherry picked from commit fbc6977fbc)
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
Jamison Dance 76373012fb Add React Rally to conferences list (#9179)
(cherry picked from commit 7253e6544b)
2017-03-24 09:49:25 -05:00
Bernard Lin 1061125572 Updated React Native EU (#9170)
* Updated Chain React

Changed conference date from "Summer 2017" to given date on website

* Updated React Native EU

Updated date and place with information from website

(cherry picked from commit 2b59afb984)
2017-03-24 09:49:25 -05:00
Andrew Clark c5395d23e5 Merge pull request #9187 from acdlite/prettierci
Failing to run prettier should block CI
(cherry picked from commit 9549ebfae5)
2017-03-24 09:48:44 -05:00
Adam 91b1cde5d6 Remove ref usage in main markdown example (#9160)
from [elsewhere in the docs](https://facebook.github.io/react/docs/refs-and-the-dom.html):

> Avoid using refs for anything that can be done declaratively.
(cherry picked from commit bf5abdf14f)
2017-03-12 15:45:59 +00: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
Sunny Ripert b2aa4d143f Fix spacing in documentation (#9070)
Replace non-breaking space by space.
(cherry picked from commit 179240ca30)
2017-03-09 20:44:06 +00:00
Vesa Laakso 0777ef9c2f Update Lifting State Up not to mix up DOM value with component state (#9032)
* Update Lifting State Up not to mix up DOM value with component state

A few weeks ago when teaching my friend, she got stuck on
`this.state.value` vs. `event.target.value`. As the documentation
talked a lot about "values", and the term value could mean three
different things (values in general, the "value" prop / DOM value of
the <input> component and the value in state/props), it was not weird
that she got a bit confused.

* Rename Lifting State Up onChange props to onTemperatureChange

This is in-line with how the temperature is provided as a prop named `temperature`

* Fix one value prop not being renamed to temperature

* Update codepen examples in Lifting state up documentation

* Update devtools state change to reflect docs change

(cherry picked from commit a190cfce29)
2017-03-09 20:44:06 +00:00
Bryan Braun 64ab3a383e Replace the header_links plugin with client-side generated anchors. (#4165)
* Replace the header_links plugin with client-side generated anchors.

Fixes facebook/react#4124

* Move anchor-link code into a separate script

Also adds a couple comments, for context.

(cherry picked from commit 7a878d27e3)
2017-03-09 20:44:06 +00:00
Fokke Zandbergen c7d14df920 Square renders button, not div (#9084)
(cherry picked from commit 8eb7068364)
2017-03-09 20:44:06 +00:00
Bernard Lin 1edc84a38c Updated Chain React (#9067)
Changed conference date from "Summer 2017" to given date on website
(cherry picked from commit fe46def5e2)
2017-03-09 20:44:05 +00:00
Dai Nguyen c04ced9c7e Update tutorial.md (#9051)
(cherry picked from commit d724aed404)
2017-03-09 20:44:05 +00:00
Stephie d6842d3140 Fixed typo: "Calcutor" to "Calculator" (#9047)
(cherry picked from commit 5cc2a4fe3e)
2017-03-09 20:44:05 +00:00
Dan Abramov c53314a3da Add more details to the doc 2017-02-19 12:08:18 +00:00
Dan Abramov 8cfc95f2d3 Doc consistency tweaks 2017-02-19 11:59:01 +00:00
Roman Matusevich 67420d1d08 Remove extra article from documentation (#9028)
(cherry picked from commit d28264e689)
2017-02-19 11:12:08 +00:00
DanZeuss 6256f3e8b0 Improved for a better understanding (#8970)
* Improved for a better understanding

that code shouldn't name this parameter onchange. It is so confusing for a starter of ReactJs like me. It looks like that the onChange is an common event from props.

* Update the lifting state up paragraph

I tried to write something to explain to starter programmers in react, how we lift the state up calling a method defined by the ancestor and called by the children that will affect the children element.

* Rewrite Lifting State Up

(cherry picked from commit fc362bf095)
2017-02-19 11:12:08 +00:00
Dan Abramov 1d786cd992 Revert "update react perf docs (#8060) and (#6174)" (#8997) 2017-02-13 23:45:32 +00:00
Dan Abramov 1d4b165476 Update Thinking in React embed to match the link (#8996)
(cherry picked from commit 2464cd2d53)
2017-02-13 23:30:52 +00:00
Jiminikiz b3fd863141 Fixing grammatical error ... (#8987)
... in the Create React App section.
(cherry picked from commit 7958c1d77d)
2017-02-13 23:30:52 +00:00
Prayag Verma 34b6e1f80c Fix a typo in design principles doc (#8985)
unambigious → unambiguous
(cherry picked from commit c60f852cdb)
2017-02-13 23:30:52 +00:00
Moacir Rosa 9e5ad597cb Only fix a small wrong key in example (#8976)
Only fix a small wrong key in example
(cherry picked from commit de673bca8d)
2017-02-13 23:30:52 +00:00
Dhyey Thakore b53a582daa update react perf docs (#8060) and (#6174) (#8236)
* update react perf docs issue 8060 and 6174

* Grammar

Small stuff

(cherry picked from commit 994a0c8b0c)
2017-02-13 23:30:52 +00:00
Andrew Clark 2a644ae7ae Merge pull request #8927 from mitenka/patch-5
Update higher-order-components.md
(cherry picked from commit b49611e643)
2017-02-13 23:30:51 +00:00
KB aff32728ca [docs] Add note about refs on stateless components (#8916)
* Add note about refs on stateless components

* Move info about refs in the stateless components to the main section

* Simplification of the part about refs and functional components

* Tweaks

* Move sections around

* Oops

* Rearrange more sections

(cherry picked from commit d42c285aa2)
2017-02-06 17:11:27 +00:00
Pontus Abrahamsson ecc6e79407 Update conferences.md (#8915)
* Update conferences.md

* Move confs around

(cherry picked from commit 55a18bca64)
2017-02-06 17:11:27 +00:00
Omid Hezaveh 49762d28e4 Explain arbitrariness of ref name in callback (#8913)
* Explain arbitrariness of ref name in callback

The sample code was confusing because it's not clear that "textInput" in this.textInput is an arbitrary name for the ref.

* Tweak wording

(cherry picked from commit 79be3543dd)
2017-02-06 17:11:27 +00:00
Dan Abramov 4a2fad0d04 Fix indentation in tutorial (#8914)
(cherry picked from commit 9e3a31b2c6)
2017-02-02 13:25:22 +00:00
Eduard 2d130bfba2 Update tutorial.md (#8896)
* Update tutorial.md

The status <div> used in Board can be deleted as well from render.

* Little tweaks

(cherry picked from commit dc04ee87ae)
2017-02-02 13:25:22 +00:00
Tiago Fernandez d5eb5a23c6 Link to CodePen editor rather than final result (#8849)
People want to see the final JS/CSS/HTML, and the final result is already displayed by CodePen.
(cherry picked from commit 05f5bf6eb6)
2017-02-02 13:25:22 +00:00
Jeffrey Wan 73a6762fe2 Update tutorial.md (#8792)
* Update tutorial.md

* Fix quoting to be consistent

(cherry picked from commit 3f5482ee20)
2017-02-02 13:25:22 +00:00
John Longanecker 952b7dec91 Lifting State Up more legible (#8691)
(cherry picked from commit b8f0522cc6)
2017-02-02 13:25:22 +00:00
Vladimir Kovpak 74b8ab5db1 Added undefined example (#8899)
Into section `Booleans, Null, and Undefined Are Ignored` I've added example with undefined.
(cherry picked from commit 8bc5a87d04)
2017-02-02 13:25:21 +00:00