Live data from Hacker News

React v16.2.0: Improved Support for Fragments

reactjs.org

1–10 of 47 posts

Re: React v16.2.0: Improved Support for Fragments

#3
Several people had already noted [0] that you could implement equivalent behavior by using a component that simply returns its own children:

    const Fragment = ({children}) => children;
    
    // later
    return ;
Nice to see this added as both a built-in component type and a useful syntax extension. (Now if they'd just modify JSX syntax so that we can pass props by matching local variable names similar to how ES6 object literals work, like ``, rather than having that become a defaulted-true boolean, I'd be happy :) )

[0] https://medium.com/@gajus/using-react-v16-to-create-self-des...

Re: React v16.2.0: Improved Support for Fragments

#5
This is a bit off topic, but does anyone reading this happen to know the status of async rendering in react?

There was chatter about it for version 16, and then nothing really else. I'm curious about what they are testing or at least planning in this area.

Unfortunately i've found it really hard to search for anything related to async rendering for react, as there is just so much other crap about react and "async" it just gets lost.

Re: React v16.2.0: Improved Support for Fragments

#6
post #3

Several people had already noted [0] that you could implement equivalent behavior by using a component that simply returns its own children: const Fragment = ({children}) => children; // later return ; Nice to see this added as both a built-in component type and a useful syntax extension. (Now if they'd just modify JSX syntax so that we can pass props by matching local variable names similar to how ES6 object literal…

To be pedantic, it's not 100% equivalent. You can find the nitty-gritty details about the (intentional) differences here: https://github.com/facebook/react/pull/10783.

We did mention the author of react-aux in the blog post though :-)

>Thanks to Gajus Kuizinas and other contributors who prototyped the Fragment component in open source.

Re: React v16.2.0: Improved Support for Fragments

#7
post #5

This is a bit off topic, but does anyone reading this happen to know the status of async rendering in react? There was chatter about it for version 16, and then nothing really else. I'm curious about what they are testing or at least planning in this area. Unfortunately i've found it really hard to search for anything related to async rendering for react, as there is just so much other crap about react and "async" it…

Fibers? I thought they were implemented and that was what React 16 was all about.

Re: React v16.2.0: Improved Support for Fragments

#8
post #5

This is a bit off topic, but does anyone reading this happen to know the status of async rendering in react? There was chatter about it for version 16, and then nothing really else. I'm curious about what they are testing or at least planning in this area. Unfortunately i've found it really hard to search for anything related to async rendering for react, as there is just so much other crap about react and "async" it…

You can track it here. Still plenty of work to do but we are making progress.

https://github.com/facebook/react/issues/8830

https://github.com/facebook/react/issues/11566

Re: React v16.2.0: Improved Support for Fragments

#9
post #7
post #5

This is a bit off topic, but does anyone reading this happen to know the status of async rendering in react? There was chatter about it for version 16, and then nothing really else. I'm curious about what they are testing or at least planning in this area. Unfortunately i've found it really hard to search for anything related to async rendering for react, as there is just so much other crap about react and "async" it…

Fibers? I thought they were implemented and that was what React 16 was all about.

From React 16 blog post (https://reactjs.org/blog/2017/09/26/react-v16.0.html):

>We think async rendering is a big deal, and represents the future of React. To make migration to v16.0 as smooth as possible, we’re not enabling any async features yet, but we’re excited to start rolling them out in the coming months. Stay tuned!

The rewrite was about adding the foundation for making this even possible. But there's still work to do before we can enable async rendering by default.

Re: React v16.2.0: Improved Support for Fragments

#10
post #5

This is a bit off topic, but does anyone reading this happen to know the status of async rendering in react? There was chatter about it for version 16, and then nothing really else. I'm curious about what they are testing or at least planning in this area. Unfortunately i've found it really hard to search for anything related to async rendering for react, as there is just so much other crap about react and "async" it…

[deleted]
Post reply on HN