How to export a pure stateless component in React? ES6 doesn’t allow export default const. You must declare the constant first then export it:
1 2 | const Header = () => { return <pre>Header |
};
export default Header;
This constraint exists to avoid writing export default a, b, c; that is forbidden: only one variable can be exported as default.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.