scrimba
Learn React
Meme generator
Project: Get random meme
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Project: Get random meme
AboutCommentsNotes
Project: Get random meme
Expand for more info
components
Meme.js
run
preview
console
import React from "react"
import memesData from "../memesData.js"

export default function Meme() {
/**
* Challenge: Get a random image from the `memesData` array
* when the "new meme image" button is clicked.
*
* Log the URL of the image to the console. (Don't worry
* about displaying the image yet)
*/
return (
<main>
<div className="form">
<input
type="text"
placeholder="Top text"
className="form--input"
/>
<input
type="text"
placeholder="Bottom text"
className="form--input"
/>
<button
className="form--button"
>
Get a new meme image 🖼
</button>
</div>
</main>
)
}
Console
/index.html
-5:42