import React, { useReducer, useState } from "react"; const initialState = { toDos: [], }; const ADD = "add"; const reducer = (state, action) => { switch (action.type) { case ADD: return { toDos: [...state.toDos, { text: action.payload }] }; default: throw new Error(); } }; const App = () => { const [state, dispatch] = useReducer(reducer, initialState); const [newToDo, setNewToDo] = useState("");..