Skip to content

Instantly share code, notes, and snippets.

@reime005
Created July 26, 2020 14:09
Show Gist options
  • Save reime005/f175e4a7a3bbe173e48c4d2160a17f81 to your computer and use it in GitHub Desktop.
Save reime005/f175e4a7a3bbe173e48c4d2160a17f81 to your computer and use it in GitHub Desktop.
import React from 'react'
import preDefinedJokes from './preDefinedJokes.json'
const VeryBigJokesList = ({ jokes = preDefinedJokes }) => {
if (!Array.isArray(jokes)) {
return <p>No jokes found.</p>
}
return (
<ul>
{
jokes.map((joke, i) => <li key={i}>{joke && joke.en}</li>)
}
</ul>
);
}
export default VeryBigJokesList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment