3 ms·
It's syntax sugar which does directly translate into JS though - you could actually just write the original/underlying code. e.g.: <Foo var={'a'}>
by BillinghamJ 7y ago
It's syntax sugar which does directly translate into JS though - you could actually just write the original/underlying code.
e.g.:
<Foo var={'a'}>
<Bar />
</Foo>
Becomes something like:
React.createElement(Foo, { var: 'a' }, React.createElement(Bar))
It all boils down to
React.createElement(component, props, ...children)
https://reactjs.org/docs/react-without-jsx.html https://reactjs.org/docs/react-without-jsx.html