react state or hooks code example Example: react hooks const [state, setState] = useState(initialState);