Redux Toolkit / React Redux
useDispatch
Returns the dispatch function for the current provided store.
Formal Syntax & Structure
react syntaxreact
const dispatch = useDispatch()Working Example
Example Snippetreact
const dispatch = useDispatch()Returns the dispatch function for the current provided store.
const dispatch = useDispatch()const dispatch = useDispatch()