Skip to content

Instantly share code, notes, and snippets.

@mrzarkovic
Created October 29, 2018 10:34
Show Gist options
  • Save mrzarkovic/d07a51650a11f06520997d66b20d1c00 to your computer and use it in GitHub Desktop.
Save mrzarkovic/d07a51650a11f06520997d66b20d1c00 to your computer and use it in GitHub Desktop.
New nested react element
var Container = React.createElement(
'div',
{className: 'container'},
React.createElement(
'h1',
{className: 'main-title'},
'Naslov'
)
);
// Objekat
{
type: 'div',
props: {
className: 'container',
children: {
type: 'h1',
props: {
className: 'main-title',
children: 'Naslov'
}
}
}
}
// HTML
<div class="container">
<h1 class="main-title">Naslov</h1>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment