Comment
DrewW
Mega Sage
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
05-12-2020
05:23 AM
That is because you used an array, the code sample that I did does not set it up as an array. Its a subtle difference but important. So with JSX you have to have one containing element for the HTML. Which in your example you do for each element of the array. If you did the following it would not work because the second array element is not wrapped in one tag, which is easily fixed by simply adding a comma.
const view = (state, { updateState }) => {
return ([
<div>
<h1>Test2 </h1>
</div>,
<div>
<h1>Test3 </h1>
</div>
<div>
<h1>Test4 </h1>
</div>
]);
};