<MovieIdea title="Interstellar" description="Love across time and space" /> import useState from 'react'; function LikeButton() const [likes, setLikes] = useState(0);
If two components need same data → move state to closest common parent. code mosh react 18 beginners fco
useEffect(() => fetch('https://movie-quote-api.com/random') .then(res => res.json()) .then(data => setFact(data.quote)); , []); // empty array = run once import useState from 'react'
Here’s a structured inspired by the teaching style of Code with Mosh (clear, practical, project-based). function LikeButton() const [likes