4 ms·
Nope, just functions. Hooks are also just functions; their "magic" comes from them being called in the same order in a component.
by robertoandred 4y ago
Nope, just functions. Hooks are also just functions; their "magic" comes from them being called in the same order in a component.
- yamtaddle 4y agoOK, so the core of React changed and they no longer use a "functional" component to build a component object, which used the be the primary data structure in the state-machine-like engine at the heart of react, and to which they used to attach the lists that contain a component's hooks? That's all changed?
- acemarke 4y agoThe two of you are talking past each other :) Component _types_ are defined as either classes (`class MyComponent extends React.Component`), or functions (`function MyComponent(props) {}`). Internally, React has a "Fiber" data structure that stores references to that component type for each component instance, as well as a lot of other metadata. That's the _real_ "component tree": - https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/#component-metadata-and-fibers https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-...