Reputation: 21
I am just learning react at the moment! I have run into an issue recently where I keep getting
SyntaxError: Unexpected token '<'
The only thing that I have changed once creating the react app, was the text in the App.js file to the following:
import React from 'react';
function App(){
return (
<button>-</button>
<span>0</span>
<button>+</button>
)
}
Tried a couple of things that Ive found on older posts, but none of them worked. Any suggestions would be greatly apprecaited!
Upvotes: 0
Views: 633
Reputation: 402
import React from 'react';
function App(){
return (
<div>
<button>-</button>
<span>0</span>
<button>+</button>
</div>
)
}
React component should return single element. In the current situation div
Upvotes: 2