| Level Navigation: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19⚡ | 20 |
Goal: Add a fetch meals function with console logging.
User Story: As a developer, I want to create a button handler so that I can test the connection to my database.
Add the fetch meals function with console logging and connect it to your button.
async function handleFetchMeals() that logs “Fetching meals…” to consoleonClick={handleFetchMeals}Need help with the button handler? Check out these snippets:
async function handleFetchMeals() {
console.log("Fetching meals...")
// We'll add the actual fetch logic in the next step
}
<button onClick={handleFetchMeals}>Fetch Meals</button>