Flashcards
Challenges
← PawWalk Academy
medium
React Native
#129
Pokemon Store (cart with limits)
Prompt
Build a Pokemon store with a cart. Requirements:
Show list of Pokemon with name and price
Cart floating button showing item count
Max 3 items per cart
Show total price on cart button
Cap cart total at $10
Hints
Show
Solution
Show
Your Code
15 min
Reset
Run
const POKEMON = [ { id: 1, name: 'Pikachu', price: 2 }, { id: 2, name: 'Charmander', price: 3 }, { id: 3, name: 'Bulbasaur', price: 4 }, { id: 4, name: 'Squirtle', price: 1 }, { id: 5, name: 'Eevee', price: 5 }, ] export default function PokemonStore() { const [cart, setCart] = useState([]) // Your code here return null }
Tests
Click Run to test your code