Mirage JS json data is console logging but not rendering on the page in React
I've made this mistake a million times. You're missing a return
statement in the employees.map
callback.
The problem with your code is here:
{employees.map(({id, firstName, lastName}) => {
<tr key={id}>
You do not return the anything from your mapping function so nothing will be rendered to the page. Try adding a return
statement like so:
{employees.map(({id, firstName, lastName}) => {
console.log(firstName);
return (
<tr key={id}>
<td>{id}</td>
<td>{firstName}</td>
<td>{lastName}</td>
</tr>
);
})}