I am new to React. I'm putting together a component that will repeat list items based on an array for a set of navigation options. I am getting the error: Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
This is my component:
import React from 'react';
const navOptions = [
{name: 'Home'},
{name: 'Me Mine and Ours'},
{name: 'Collection'},
{name: 'Yo!'}
];
const Nav = () => {
navOptions.map((name, index) => {
return (
<li className="nav-item">
<a className="nav-link" href="#" key="">j</a>
</li>
)
})
};
export default Nav;