🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

Project 4: Photo Gallery

React Engineer

Builds on these lessons

Step 1 of 2
Project

What Hooks Are

Add a comment noting useState and useEffect are both "hooks" — functions starting with use that let a function component tap into React features like state and lifecycle, which class components used to need for the same thing.

🎯 Your Task

Please add the exact code shown in the light gray box below to your editor.Do not delete your previous code, just insert these new lines in the correct place!

import { useState } from "react";

// Hooks are functions starting with "use" that let a function component tap into
// React features (state, lifecycle, context) without writing a class.
export default function PhotoGallery() {
  const [photos, setPhotos] = useState([]);

  return <div>{photos.length} photos</div>;
}