Skip to main content
๐Ÿ› Bug HuntRX React Easyโšก+10 XP

State Mutation

The UI doesn't update when the array changes.

๐Ÿ› Find the bug
1const [items, setItems] = useState([]);
2const addItem = (item) => { items.push(item); };
๐Ÿ› The bug is on line 2

๐Ÿ”ง Select the correct fix: