I'm new to React and ES6, still struggling in understanding its syntax, below is an example code from my book:
import React from 'react';
export const App = () => <h1 className="bg-primary text-white text-center p-2">
Hello Adam
</h1>
export default App;
but why I have to use 'const' as well, why I can't do like;
export default App = () => <h1 className="bg-primary text-white text-center p-2">
Hello Adam
</h1>
it compiled but caused an runtime error,which I don't know why, I always can do the following without any errors:
export default function (…) { … }
I'm really confused