I really like the new React hooks and I\'m using them frequently for a project I\'m working on. I\'m coming across a situation where I want to use the prevState in the
You have already the previous state in the destructed variable: someState
someState
so you can do:
const [ someState, setSomeState ] = useState( new Map() ) setSomeState( someState.set( key, value ) )