Live data from Hacker News

React v16.3.0: New lifecycles and context API

reactjs.org

21–30 of 133 posts

Re: React v16.3.0: New lifecycles and context API

#21
post #10

I like that they are taking the deprecation of the lifecycle methods slowly. And the automated script to migrate to the 'UNSAFE' version of those methods in 17 is a nice touch. I don't know if I love the new context API, but it's great they're giving an official option. Of the big JS frameworks that are popular at the moment, I think the React team is doing the best job of balancing new features with minimizing devel…

Using refs to talk to the DOM is a leaky abstraction, but talking the the DOM is a necessity in a framework that renders to the DOM. Before forwardRef, you'd end up with ad-hoc prop names like `domRef` to try to wallpaper around the leak.

I'm happy to see a thoughtful solution. There are some things you just can't do with React alone (like listen for PointerEvents).

Re: React v16.3.0: New lifecycles and context API

#22
I have very mixed feelings about the new context api. On one hand, you're taking a foot-gun away, which I approve of having worked on code bases that abused it. On the other hand, it's very clunky, and I think people who abused the old context will just start making components larger, and wrapping them in a single context, rather than doing the right thing with many small components individually wrapped. Personally I think props inheritance, with IsolatedComponent as an escape hatch/boundary would have been much cleaner.

Re: React v16.3.0: New lifecycles and context API

#24

I have very mixed feelings about the new context api. On one hand, you're taking a foot-gun away, which I approve of having worked on code bases that abused it. On the other hand, it's very clunky, and I think people who abused the old context will just start making components larger, and wrapping them in a single context, rather than doing the right thing with many small components individually wrapped. Personally I…

Would you elaborate on what you find clunky about the new context API? :)

Re: React v16.3.0: New lifecycles and context API

#25
post #9

In the unlikely scenario of Facebook's demise, how do you think the maintenance of React would transpire? Do you think some other tech company would snatch up the design leads, and pick up the torch? Would it go into its own independent organization?

React could easily spin off into its own org funded by donations.

Re: React v16.3.0: New lifecycles and context API

#26
post #9

In the unlikely scenario of Facebook's demise, how do you think the maintenance of React would transpire? Do you think some other tech company would snatch up the design leads, and pick up the torch? Would it go into its own independent organization?

There is no demise coming for Facebook.

They'll clean up, grandma, aunty and the school mothers will continue posting and they never even knew there was an issue.

People will soon forget.

Re: React v16.3.0: New lifecycles and context API

#29
post #20
post #10

I like that they are taking the deprecation of the lifecycle methods slowly. And the automated script to migrate to the 'UNSAFE' version of those methods in 17 is a nice touch. I don't know if I love the new context API, but it's great they're giving an official option. Of the big JS frameworks that are popular at the moment, I think the React team is doing the best job of balancing new features with minimizing devel…

“higher order components should be the exception, not the rule.” This just isn’t true. Abstracting form logic. Request logic. Anything else you use across your app. Connect in redux. There are hundreds of good reasons to have a higher order component. It makes testing easy. Test your request logic in one place, anything that uses it is now a stateless component, and testing it is trivial.

Render props can solve many of those problems without Higher order components.

Re: React v16.3.0: New lifecycles and context API

#30

I use and love React, but I'm also a little scared of it. I opened this little app I did 1 year ago in React 15, and it's completely incompatible with what I use now. Every time I read of a new release I get this chill down my spine for a second.

Our upgrade process is very gradual. As long as you've fixed all of the dev warnings for the last minor release of a given version, you should be able to upgrade to the next major without any problem.
Post reply on HN