SPRING CONCEPTS
React state
Spring Concepts / React state
React state holds values whose changes should update the interface.
Understand the idea
useState returns a value and a setter. Call the setter to request a render with a new value. Controlled inputs pair their displayed value with a handler that updates state. The frontend maintains separate state for login, task fields, list data, and messages.
A concrete example
const [todos, setTodos] = useState([]);
setTodos(await api("/api/todos"));In the application
App.jsx updates the list after successful CRUD and clears user state on logout.
State is not a secure database. A reload resets this app’s in-memory authentication state.