Coding task · JavaScript and React course · Module 3: State and Events
Practice: Multiple States
Each useState is a separate, independent colony system: changing one state does not touch the others.
Task
Create a ColonyDashboard component with four separate useState states: temperature (e.g. -20), pressure (e.g. 600), oxygen (e.g. 21) and power (e.g. 80), and render it in App. Display all four values and, for each of them, add a button that changes only that value (e.g. Heat +5, Pressure +10, Oxygen +1, Power -10).