r/reactjs • u/PM_ME_HTML_SNIPPETS • Jul 26 '17
React 16 beta | First release of react that ships fiber
https://github.com/facebook/react/issues/1029416
13
u/terrcin Jul 27 '17
Just swapped it in on a new app I'm developing and worked without an code changes. Nice work everyone involved!
9
u/madcaesar Jul 27 '17
Returning arrays from render and error handling are huge!
2
u/stefan_walker68 Jul 27 '17
Returning arrays from render sounds interesting, any more info?
11
Jul 27 '17
You don't need to wrap your elements in a parent element when rendering:
return ( <li>item 1</li> <li>item 2</li> <li>item 3</li> )4
0
Jul 27 '17
[deleted]
2
Jul 28 '17
Yeah. The JSX transpiler itself hasn't changed as far as I know, so that JSX is still invalid, because it would transpile to something like this:
return React.createElement("li", null)React.createElement("li", null)React.createElement("li", null)That obviously still doesn't make any sense. What they did was made it so when you return an actual array, React can handle that.
2
1
u/HQxMnbS Jul 27 '17
anyone add this to an ejected create-react-app yet? sorta works, giving me a random warning about some element not being supported by the browser
1
u/PM_ME_HTML_SNIPPETS Jul 28 '17
Not yet. I tried to create a react-scripts version with it, but I can't test for some reason.
When I run the CRA command, it says "cannot find module
<path to project>/node_modules/react-scripts/package.json"; if anyone knows how to fix this issue, I could test, otherwise it's there for you to try.
6
0
Jul 27 '17
Tried to migrate my app. Tons of my plugins still brake 16.0.0 beta 1 sadly.
1
u/Capaj Jul 27 '17
what version were you previously on? They claim if you migrate from 15 you should not have any issues.
4
Jul 27 '17
3rd party libraries might break regardless of whether your code is ready for the transition.
7
u/PM_ME_HTML_SNIPPETS Jul 27 '17
Yep, says as much in the "Points of Interest" section:
Third party libraries that relied on deprecated or unsupported APIs may need updates to work correctly with this new release. Now is a good time to file issues against libraries that have problems. (And tell us if we broke something!)
0
1
Jul 27 '17
Do you remember what the errors said? We have a large application with dozens of plugins and packages, but mostly just prop-types left over on our side that caused errors since React.proptypes doesn't exist any longer. Once that was fixed it ran.
1
-2
u/newtmitch Jul 27 '17
Man, Node 8 and React 16 - my tech debt outlook is getting more and more interesting. :)
1
u/lamhocminh Jul 27 '17
Why
0
u/newtmitch Jul 27 '17
I just have several things stacking up that I need to get in front of, is all. React 16 is definitely there.
1
u/lamhocminh Jul 28 '17
If you just start you not need worry so much these thing :) even you learn the old react is ok for you learn. I hope you have the good time you learn not so stress. Many programmer the stress
0
29
u/PM_ME_HTML_SNIPPETS Jul 26 '17 edited Jul 26 '17
Taken from the page:
EDIT: isfiberreadyyet.com