Commit Graph
7346 Commits
Author SHA1 Message Date
Dan Abramov e1ee94ca17 Add more highlighting to docs (#8076)
* Tweak JSX in Depth

* Add highlighting to Refs and the DOM

* More tweaks
2016-10-24 15:48:46 +01:00
Toru Kobayashi 6cdc610bcc [Fiber] Add types for ReactFiber and ReactChildFiber (#8072)
* Add Types for ReactFiber

* Add Types for ReactChildFiber
2016-10-24 14:20:44 +01:00
Marcio Puga 6fa1ddbdb4 Fix typos (#8067) 2016-10-24 13:50:04 +01:00
Ashish 8333b891e4 Docs : Fix createClass reference (#8073)
Currently react.createClass is wrongly referenced to #react.createclass. Changed it to #createclass!
2016-10-24 13:34:17 +01:00
Sebastian Markbåge 69d725f764 Merge pull request #8055 from sebmarkbage/fiberclassname
Accept className in ReactDOMFiber
2016-10-23 17:04:03 -04:00
Dan Abramov 156639241e Remove references to createClass in createElement docs (#8064) 2016-10-23 15:48:58 +01:00
Dan Abramov 46eca10046 Link to lifecycle methods from Context doc (#8062) 2016-10-23 14:35:23 +01:00
Andrew Poliakov 4e98dba6d3 Update tutorial.md, Taking Turns (#8058) 2016-10-23 13:49:55 +01:00
Alireza Mostafizi e527b3a464 Update handling-events.md (#8057) 2016-10-23 13:44:29 +01:00
William Hoffmann 29f5da8de4 Fix typo (#8056) 2016-10-23 13:44:08 +01:00
Giuseppe 74026fd9ea Docs replace reference to 'getInitialState' with 'state' instance property in "Thinking in React" (#8059) 2016-10-23 13:41:37 +01:00
Sebastian Markbage 51f1205fb4 Accept className in ReactDOMFiber
This isn't a complete solution to all attributes. It's just that
we run a lot of unrelated unit tests by testing className so
we need it for the tests.
2016-10-22 17:57:33 -07:00
Jason Grlicky 952bdca020 Fix for typos (#8046) 2016-10-22 16:50:24 -07:00
Jun Kim 284a96b9a6 Fix illogical code in tutorial.md (#8048)
The tutorial wants to throw a 'warning' and explains about 'key' of React's list, but it throws nothing since there is sensible key.
"key={move}" should be removed, and added after explaining about key.
2016-10-22 16:49:07 -07:00
Diego Muracciole 461a74115c Injected Host Component classes are not being considered by the reconciler (#8050)
* Consider Host Component classes when creating a new internal instance

* Remove unused tagToComponentClass & injectComponentClasses from ReactHostComponent
2016-10-22 17:28:37 -05:00
Phil Quinn cf37402338 correct order of params in documentation (#7989) 2016-10-22 21:59:54 +01:00
Brad Vogel 01753cde85 "take part in" is the correct saying (#8013) 2016-10-22 21:57:57 +01:00
Sebastian Markbåge 57f07777ef Fix relative link in Hello World (#8041)
* Fix relative link in Hello World

This links https://facebook.github.io/docs/installation.html which redirects to https://code.facebook.com/

* Update hello-world.md

* Fix link
2016-10-22 21:56:53 +01:00
Oskari Mantere 38c22252f4 Replace vars with let and const (#8051) 2016-10-22 21:55:29 +01:00
Avinash Kondeti 6810627a91 Fix: updated with new docs links (#8049) 2016-10-22 21:53:52 +01:00
Jun Kim 37f94bd3bb Fix typo in tutorial.md (#8047)
changges -> changes
2016-10-22 21:52:29 +01:00
Taeho Kim a5ff2f1e9c Fix typo in new tutorial code (#8045) 2016-10-22 21:46:51 +01:00
Nathan Hardy f7cb6cbe15 Fix erroneous '}' in JSX examples (#8043) 2016-10-22 21:45:29 +01:00
Cody Reichert 4d3c5ea23c Fix anchor link for displayName (#8040) 2016-10-22 21:44:51 +01:00
Ragnar Þór Valgeirsson 7340fa9d93 Convert the Number component to ListItem (#8039)
* Convert the Number component to ListItem

* Add updated example CodePen

Also fixes typos.
2016-10-22 21:44:28 +01:00
BEAUDRU Manuel 54dfe0b43c Wrong library name reference in tutorial.MD (#8038)
* Update tutorial.md

Seems like you are talking about immutable.js and not immutability.js which doesn't exist :)

* Capitalize Immutable.js
2016-10-22 21:43:15 +01:00
Ben Alpert fa82e3e9d6 Update website on Travis when only new files are added (#8037)
This build didn't commit the new files because no existing files were changed:

https://travis-ci.org/facebook/react/jobs/169622664

This should work better.
2016-10-22 21:41:29 +01:00
Christopher Chedeau 4812f26915 Update components-and-props.md
fb indent style
2016-10-21 18:30:25 -07:00
Christopher Chedeau eb118b7037 Update react-without-jsx.md
Facebook codestyle
2016-10-21 14:30:35 -07:00
Dan Abramov d1a61ee7f4 Fix redirects 2016-10-21 22:02:30 +01:00
Dan Abramov 1f818f2740 Minor doc tweaks 2016-10-21 21:47:43 +01:00
Kevin Lacker 455d2d1b48 New Documentation 2016-10-21 20:59:08 +01:00
Sebastian Markbåge 8cac523bea Merge pull request #8029 from sebmarkbage/fiberreturnfromtoprender
Quick fix to the return top level problem
2016-10-21 14:59:01 -04:00
Sebastian Markbage 6e7c89ed8a Quick fix to the return top level problem
This doesn't deal with the fact that work is usually deferred
so this will return null for first render (except in sync tests).
It also doesn't deal with top levels being fragments etc.
It doesn't deal with the host instance type being a wrapper
around the public instance. This needs to be unified with refs
and findDOMNode better.

However, this does expose that we reactComponentExpect and
ReactTestUtils doesn't work very well with Fiber.
2016-10-21 11:58:40 -07:00
Sebastian Markbåge 9b1b40ca93 Merge pull request #8015 from sebmarkbage/fiberclassinit
[Fiber] Add more life-cycles
2016-10-21 14:57:51 -04:00
Sebastian Markbage 37ca3874af Add unit tests for aborted life-cycles
This tests the life-cycles when work gets aborted.
2016-10-21 11:57:24 -07:00
Sebastian Markbage c862ba719e Fallback to current props if memoizedProps is null
If work has progressed on a state update that gets resumed
because of another state up, then we won't have an new
pendingProps, and we also won't have any memoizedProps because
it got aborted before completing. In that case, we can just
fallback to the current props.

I think that they can't have diverged because the only way they
diverge is if there is new props.

This lets us bail out on state only updates in more cases which
the unit tests reflect.
2016-10-21 11:57:24 -07:00
Sebastian Markbage b72c27ce5d Don't schedule NoWork as the next work
We currently only filter out "NoWork" in the beginning of this
function. If the NoWork root is after the one with work it will
show up in the second loop. There's probably a more efficient
way of doing this but this works for now.

This showed up in this PR because a new unit test gets unblocked
which ends up with this case.
2016-10-21 11:57:24 -07:00
Sebastian Markbage a87ec42f2a Add more life-cycles to Fiber
This refactors the initialization process so that we can share
it with the "module pattern" initialization.

There are a few new interesting scenarios unlocked by this.
E.g. constructor -> componentWillMount -> shouldComponentUpdate
-> componentDidMount when a render is aborted and resumed.
If shouldComponentUpdate returns true then we create a new
instance instead of trying componentWillMount again or
componentWillReceiveProps without being mounted.

Another strange thing is that the "previous props and state"
during componentWillReceiveProps, shouldComponentUpdate and
componentWillUpdate are all the previous render attempt. However,
componentDidMount's previous is the props/state at the previous
commit. That is because the first three can execute multiple
times before a didMount.
2016-10-21 11:57:24 -07:00
Toru Kobayashi a6728f961c [Fiber] Add unit tests for ReactDOMFiber (#8016) 2016-10-21 00:44:23 -04:00
Sebastian Markbåge 4132cc4d3e Fix lint with yarn (#7997)
I couldn't figure out how to do this yarn alone so I ended up
just manually hacking the yarn to force a downgrade of babylon
to 6.8.0 since otherwise it gets resolved to 6.12.0 which is
broken.
2016-10-20 17:49:40 -04:00
Ben Alpert a8beab3341 Fix captured/bubbled in ReactNativeTreeTraversal (#8019)
Follow-up to #7741. Added a test for RN event bubbling that fails before the fix.
2016-10-20 11:17:06 -07:00
Sebastian Markbåge a5195102d4 [Fiber] Some setState related issues (#8010)
* Use the memoized props/state from the workInProgress

We don't want to use the "current" props/state because if we have
started work, then pause and continue then we'll have the newer
props/state on it already. If it is not a resume, it should be the
same as current.

* Deprioritize setState within a deprioritized tree

Currently we flag the path to a setState as a higher priority
than "offscreen". When we reconcile down this tree we bail out
if it is a hidden node. However, in the case that node is already
completed we don't hit that bail out path. We end up doing the
work immediately which ends up committing that part of the tree
at a higher priority.

This ensures that we don't let a deprioritized subtree get
reconciled at a higher priority.

* Bump idx in unit test

This proves that this number is actually deprioritized.
2016-10-19 13:32:37 -04:00
Toru Kobayashi 3d7869ab0e [Fiber] Add a unit test for ReactTopLevelText (#8001) 2016-10-18 14:39:49 -04:00
Dan Abramov 9bfa45bd2d Update Flow and fix issues (#8006) 2016-10-18 15:26:40 +01:00
Dan Abramov 75367673cf Fix Haste header (#8005) 2016-10-18 14:06:08 +01:00
Andrew Clark 663d4a539b Merge pull request #8000 from piperchester/patch-1
Fix grammatical error
2016-10-17 21:26:22 -07:00
Piper Chester 31f5edc492 Fix grammatical error 2016-10-17 21:13:33 -07:00
Sebastian Markbage fae3e5308b Use memoizedState in componentDidUpdate
We forgot to clone this value so it didn't work before.
This is covered by existing tests in ReactDOMProduction.
2016-10-17 16:21:06 -04:00
Sebastian Markbage 685d65bfb6 No duck typing on the root
The root is always a host container.
2016-10-17 16:21:06 -04:00