const [state, setState] = React.useState({});setState(prevState => { // Object.assign would also work return {...prevState, ...updatedValues};});