A Component Is Just A Bag Of Data
Last updated
Was this helpful?
Last updated
Was this helpful?
If you write enough React using JSX, it is easy to forget that you're not working with markup. Everything -- div
s, h1
s, 3rd party components, your components -- all get boiled down to JavaScript objects full of data.
Any given React component is really just a bag of data. Try doing a console.log
to see. Here is an example from an .
Looking in the console, we see the following output:
It contains information about the component itself and because of the tree structure of this data, you could potentially expand the props
--> children
sections several times for certain components.
See a .