I'm getting the error:
Error: Unexpected token. Did you mean
{'}'}
or}
? JSX element
With this code:
function CompositeCntl() {
return (
<div>
<Button />
<Display />
<div/>
);
}
{<div
/> }--> self-closing
{<div></div
>} ---> closing tag
I accidentally put the slash after the closing div:
<div/>
This is how to correct it:
function CompositeCntl() {
return (
<div>
<Button />
<Display />
</div>
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With