Commit Graph
2327 Commits
Author SHA1 Message Date
Luke BelliveauandBrandon Dail 6c8fd16a06 Amended implementation-notes.md with link to Dan Abramov's post describing difference between React components, elements, and instances (#9388)
* Amended implementation-notes.md to include a link to a blog post by Dan Abramov, explaining the difference between components, elements, and instances. An understanding of this distinction is crucial in tracing through Implementation pseudocode, and reading Dan's blog first may ease newcomers into understanding the implementation.

* adjusted wording to maintain stylistic consistency with rest of content, per @aweary's request
2017-04-09 14:37:41 -05:00
Aaron AckermanandDan Abramov d3d4b599b9 Point users to the npm page instead of the github project for prop-types (#9373) 2017-04-08 04:05:34 +01:00
Andrew ClarkandGitHub e5ce3fd368 Blog post and changelog for 15.5.0 (#9368) 2017-04-07 14:41:16 -07:00
Flarnie MarchanandAndrew Clark 6eaa539ad5 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 13:47:54 -07:00
Flarnie MarchanandAndrew Clark 8f7281199d 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-06 17:20:54 -07:00
Dan AbramovandGitHub 665f80483e Update build paths in docs (#9340) 2017-04-05 16:53:25 +01:00
JustinandBrandon Dail 0c7863075d 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-04 17:16:54 -05:00
Ben AlpertandGitHub e50f97b4cb Update addons-two-way-binding-helpers.md
I don't think this reference is that helpful and could turn people away since it sounds very fancy and isn't relevant..
2017-04-04 11:14:09 -07:00
Aaron CannonandBrandon Dail 50b3cab3ec Make it clear that textarea also supports defaultValue. (#9318) 2017-04-03 23:05:50 -05:00
Dan AbramovandGitHub 4a37718e4e Remove examples/ folder (#9323) 2017-04-03 20:32:02 +01:00
Damian NicholsonandDan Abramov 0c70fb8b18 Added semicolons to addons imports examples. (#9287) 2017-03-30 15:55:27 +01:00
najisawasandBrandon Dail c47f334ac9 Fixed typo on implementation notes page (#9258)
Added paren to "mountComponent()" for consistency
2017-03-25 20:57:28 -05:00
Johan TinglöfandBrandon Dail 38d8f3ee6b Updated Router import for example (#9233)
Updated import in order to be a correct working example as in accordance with the docs
2017-03-24 09:37:32 -05:00
Bernard LinandBrandon Dail fbc6977fbc Conferences (#9234)
* standard format for React Rally

* move React Conf 2017 to past conferences
2017-03-22 10:40:13 -05:00
Dan AbramovandGitHub 34e4352cba Delete addons (#9209)
* Delete addons

* Remove ReactFragment dependency from tests

* Remove addons testing from fixtures

* Don't mention createFragment() in a warning

* Address feedback

* Remove unused variables

* Remove mention of deleted file

* Add a missing key to the test

* Fix lint
2017-03-20 16:15:01 +00:00
CodinCatandDan Abramov 0ceb5115ac Use single quotes, remove extra whitespace (#9215) 2017-03-19 18:34:53 +00:00
Andrew Clark c71a8ecd00 Add prettier instructions to PR template and contribution guide 2017-03-16 11:53:44 -07:00
Jamison DanceandBrandon Dail 7253e6544b Add React Rally to conferences list (#9179) 2017-03-15 14:20:57 -10:00
Bernard LinandDan Abramov 2b59afb984 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
2017-03-13 22:43:03 +00:00
AdamandDan Abramov bf5abdf14f 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.
2017-03-12 15:29:10 +00:00
Dan AbramovandGitHub 7fa311bcd9 Reorder sections in alphabetical order (#9143)
* Reorder sections in alphabetical order

* Reorder here too
2017-03-09 20:46:55 +00:00
Dima BeznosandBrandon Dail 0bedd0697a Added Brunch build tool to the docs (#9074)
* Added Brunch build tool to the docs

* Improved grammar

* product build -> production build
2017-03-03 16:15:25 -06:00
Sunny RipertandBrandon Dail 179240ca30 Fix spacing in documentation (#9070)
Replace non-breaking space by space.
2017-03-02 13:57:58 -06:00
Vesa LaaksoandDan Abramov a190cfce29 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
2017-03-02 00:28:09 +00:00
Bryan BraunandKevin Lacker 7a878d27e3 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.
2017-03-01 11:52:54 -08:00
Fokke ZandbergenandBrandon Dail 8eb7068364 Square renders button, not div (#9084) 2017-03-01 09:40:45 -06:00
Bernard LinandBrandon Dail fe46def5e2 Updated Chain React (#9067)
Changed conference date from "Summer 2017" to given date on website
2017-02-27 09:53:47 -06:00
Dai NguyenandBrandon Dail d724aed404 Update tutorial.md (#9051) 2017-02-23 14:54:03 -06:00
StephieandDan Abramov 5cc2a4fe3e Fixed typo: "Calcutor" to "Calculator" (#9047) 2017-02-22 17:37:55 +00:00
Dan AbramovandGitHub 51733c9a36 Add more details to the doc 2017-02-19 12:07:54 +00:00
Dan AbramovandGitHub 6d6211f526 Doc consistency tweaks 2017-02-19 11:58:42 +00:00
Roman MatusevichandDan Abramov d28264e689 Remove extra article from documentation (#9028) 2017-02-19 11:10:50 +00:00
DanZeussandDan Abramov fc362bf095 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
2017-02-19 02:21:05 +00:00
Dan AbramovandGitHub 7bdc189147 Revert "update react perf docs (#8060) and (#6174)" (#8997) 2017-02-13 23:43:08 +00:00
Dan AbramovandGitHub 2464cd2d53 Update Thinking in React embed to match the link (#8996) 2017-02-13 23:25:47 +00:00
Sean GranseeandBrandon Dail c16ec5df13 fix misspellings in comments and tests (#8946)
* fix misspellings in comments and tests

* revert change in docs/js/react-dom.js
2017-02-13 16:01:54 -06:00
Dan AbramovandGitHub 4a05f268c8 Revert "Fix createNodeMock doc to avoid Invariant Violation" (#8990) 2017-02-13 20:15:49 +00:00
BDav24andDan Abramov 00092957b6 Fix createNodeMock doc to avoid Invariant Violation (#8989) 2017-02-13 20:13:31 +00:00
JiminikizandBrian Vaughn 7958c1d77d Fixing grammatical error ... (#8987)
... in the Create React App section.
2017-02-13 10:04:09 -08:00
Prayag VermaandDan Abramov c60f852cdb Fix a typo in design principles doc (#8985)
unambigious → unambiguous
2017-02-13 15:09:00 +00:00
Moacir RosaandDan Abramov de673bca8d Only fix a small wrong key in example (#8976)
Only fix a small wrong key in example
2017-02-10 15:40:24 +00:00
Dhyey ThakoreandKevin Lacker 994a0c8b0c update react perf docs (#8060) and (#6174) (#8236)
* update react perf docs issue 8060 and 6174

* Grammar

Small stuff
2017-02-07 14:00:08 -08:00
Andrew ClarkandGitHub b49611e643 Merge pull request #8927 from mitenka/patch-5
Update higher-order-components.md
2017-02-06 11:42:31 -08:00
KBandDan Abramov d42c285aa2 [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
2017-02-06 16:49:36 +00:00
Dmitry Zhuravlev-NevskyandGitHub 1b69a79136 Update higher-order-components.md 2017-02-04 03:35:06 +03:00
Diego MuraccioleandDan Abramov ad133f5b3d Add onToggle event to details tag (#8831)
* Add onToggle event to details tag

Fixes #8761

* Map onToggle event on ReactDOMFiberComponent

* Tweak doc

* Trap events on setInitialProperties for details tag
2017-02-03 10:25:09 +00:00
Pontus AbrahamssonandDan Abramov 55a18bca64 Update conferences.md (#8915)
* Update conferences.md

* Move confs around
2017-02-02 13:37:27 +00:00
Omid HezavehandDan Abramov 79be3543dd 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
2017-02-02 13:33:12 +00:00
Dan AbramovandGitHub 9e3a31b2c6 Fix indentation in tutorial (#8914) 2017-02-02 13:24:26 +00:00
EduardandKevin Lacker dc04ee87ae Update tutorial.md (#8896)
* Update tutorial.md

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

* Little tweaks
2017-02-01 18:12:00 -08:00