Comments (1)
Class components are no longer recommended, but they are not deprecated (see https://react.dev/reference/react/legacy).
Much existing code uses class components, so class components won't be removed anytime soon.
We intend for Hooks to cover all existing use cases for classes, but we will keep supporting class components for the foreseeable future. At Facebook, we have tens of thousands of components written as classes, and we have absolutely no plans to rewrite them. Instead, we are starting to use Hooks in the new code side by side with classes. (https://legacy.reactjs.org/docs/hooks-intro.html#gradual-adoption-strategy)
That being said, I have heard that class components might be moved into a separate package in a future release (to decrease the size of the package for new projects that don't use any class components), though I don't know if that's accurate. @gaearon @sophiebits @acdlite Could someone from the React team please confirm?
from react.
Related Issues (20)
- React Project Doesn't display on browser HOT 2
- Bug: Undo/Redo not behaving as expected for controlled input when state is updated from an async callback HOT 3
- Bug: React can leak the whole subtree when using contentEditable (reproduction sscce included) HOT 2
- Request: Define to exports cjs/* files in package.json
- Feature request: Define prop preprocessor
- Bug: errors caught by error boundaries appear in console twice HOT 1
- Bug: `flushSync` does not work HOT 2
- Bug: Next.js Build Errors Fix HOT 1
- Bug: Use useId function to generate dom id,it can't use document.querySelector function. HOT 6
- Bug: Despite having implemented optimizations such as shouldComponentUpdate or PureComponent HOT 7
- Bug: unable to compile standalone binary in Deno with server rendering, while using Typescript.
- RSS feed for the blog HOT 3
- Bug: Using useSyncExternalStore with SSR and no getServerSnapshot results in error HOT 6
- Nested <form> elements error with "A React form was unexpectedly submitted." HOT 11
- I am very much looking forward to React having an ESM bundle version similar to Vue, specifically designed for the tree Shaking feature in Rollup, which is convenient to package into NginxScript's njs for SSR use HOT 1
- [DevTools Bug]: Error: Should have a queue. This is likely a bug in React. Please file an issue. HOT 5
- Bug: state update from a rAF in useLayoutEffect not batched when using `createRoot` HOT 7
- New hook: useMemoWithPrev HOT 1
- Bug: Component's redux state value resets to null even though no action to do so initiated HOT 1
- Bug: unstable_runWithPriority continious loop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.