createDispatchHook<TReduxState> function

dynamic Function(dynamic action) Function() createDispatchHook<TReduxState>([
  1. Context? context
])

Returns a function that can be named and used as a replacement for useDispatch when you want to use custom context.

This is useful if you're building a complex reusable component, and you don't want your Store to collide with any Redux Store your consumers' applications might use.

See the react-redux JS documentation for more details.

See the createSelectorHook documentation for an example of creating / using custom context.

Implementation

dynamic Function(dynamic action) Function() createDispatchHook<TReduxState>([Context? context]) {
  return _jsCreateDispatchHook(context?.jsThis ?? JsReactRedux.ReactReduxContext);
}