Created
July 26, 2020 14:09
-
-
Save reime005/f175e4a7a3bbe173e48c4d2160a17f81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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