While browsing through the internet, I came across React element objects:
{
type: 'button',
props: {
className: 'button button-blue',
children: {
type: 'b',
props: {
children: 'OK!'
}
}
}
}
What I understood is that they're basically transformed into the following JSX when the React component is rendered:
<button class='button button-blue'>
<b>
OK!
</b>
</button>
However, whatever React projects I have done until now, I have never used these React element objects. Also, I didn't find any mention of it in all the React videos I have watched online to date.
Where do we use React element objects? I read this article from the official React docs, however, I still wasn't able to get the answer to my question.