4 ms·
I cant imagine saying upgrading is painless considering the way how React deprecated class components.
by veidelis 2y ago
I cant imagine saying upgrading is painless considering the way how React deprecated class components.
- acemarke 2y agoWhat specifically are you referring to? The original `createClass` API was indeed deprecated and removed all the way back in 2017 [0]. You can still use them today with the separated `create-react-class` package. ES6 class components still work as-is even in React 19 - it's just the legacy context feature that's been removed. They're generally discouraged, in that function components are now the standard way to use React, but they're still not "deprecated" in the sense of a warning or removal. [0] https://legacy.reactjs.org/blog/2017/09/26/react-v16.0.html#packaging https://legacy.reactjs.org/blog/2017/09/26/react-v16.0.html#...
- veidelis 2y agoThey deprecated AFAIR 3 methods on class components and the docs about class components under "Legacy React APIs" say that it's a pitfall to use class components.
- alexanderchr 2y agoYeah they deprecated those three methods a long time around (sometime around 16.3 I think) yet they are still around in 19.0 (with an UNSAFE_ prefix). Regarding class components in general, what is the problem with maintainers choosing to encourage devs to use their new APIs while keeping the old APIs working?
- aidos 2y agoThe react team have done an incredible job maintaining backwards compatibility across versions over the years. They’ve even fought for bug parity when doing major internal rewrites.
- robertoandred 2y agoGood thing class components are not deprecated. Where’d you get that from?