You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But that's not how most people actually structure their React code. Instead, they continue to model their application as an aggregation of conceptual objects a la OOP. Forms. Widgets. Color pickers and the like. Each with its own persisted state. The fact that you've architected React to avoid semantic classes is orthogonal to the fact that people are still using it to implement conceptual classes.
(amongst other things)
The text was updated successfully, but these errors were encountered:
says HOC is bad (passing callbacks into the component):
importwithThemefrom'./withTheme';importwithAuthfrom'./withAuth';importwithDatafrom'./withData';importwithLoggingfrom'./withLogging';functionMyComponent({ theme, user, data }){return(<divstyle={{backgroundColor: theme.background}}><h1>Welcome, {user.name}</h1><p>Data: {data}</p></div>);}// Wrapping the component with multiple HOCsexportdefaultwithTheme(withAuth(withData(withLogging(MyComponent))));
https://react.dev/reference/react/Component says
We recommend defining components as functions instead of classes. See how to migrate.
https://news.ycombinator.com/item?id=35187959#:~:text=%3E%20Why%20did%20react%20(effectively),%3E says
But that's not how most people actually structure their React code. Instead, they continue to model their application as an aggregation of conceptual objects a la OOP. Forms. Widgets. Color pickers and the like. Each with its own persisted state. The fact that you've architected React to avoid semantic classes is orthogonal to the fact that people are still using it to implement conceptual classes.
(amongst other things)
The text was updated successfully, but these errors were encountered: