React Base Fiddle (JSX)
Starting point for creating JSFiddles with React.
HTML
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
Babel + JSX
class Data extends React.Component {
render() {
const dataItems = [{
"title": "tab1",
"content": [
{
"imageUrl": "http://placehold.it/300x300",
"title": "title1",
"description": "Short description explaining the use of this design in a single sentence."
},
{
"imageUrl": "http://placehold.it/300x300",
"title": "title2",
"description": "Short description explaining the use of this design in a single sentence."
},
{
"imageUrl": "http://placehold.it/300x300",
"title": "title3",
"description": "Short description explaining the use of this design in a single sentence."
}
]
},
{
"title": "tab2",
"content": [{
"imageUrl": "http://placehold.it/300x300",
"title": "title1",
"description": "Short description explaining the use of this design in a single sentence."
}]
},
{
"title": "tab3",
"content": [{
"imageUrl": "http://placehold.it/300x300",
"title": "title1",
"description": "Short description explaining the use of this design in a single sentence."
}]
},
{
"title": "tab4",
"content": [{
"imageUrl": "http://placehold.it/300x300",
"title": "title2",
"description": "Short description explaining the use of this design in a single sentence."
}]
}]
return (
<div>
{dataItems.map((item, index) => {
return (
<div>
<h1>{item.title}</h1>
<img src={item.content.imageUrl} />
<strong>title: {item.content.title}</strong>
<p>description: {item.content.description}</p>
<hr/>
</div>
)
})}
</div>
)
}
}
ReactDOM.render(
<Data />,
document.getElementById('container')
);