useDvaProps function

Props useDvaProps({
  1. String? namespace,
})

A hook that retrieves only the Props instance from the Dva Store.

Unlike useDvaConnect, this hook does not subscribe to Store state changes, so the widget will not automatically rebuild when the state changes. Use this when you only need to dispatch actions or access navigation history.

namespace - Optional namespace to associate with the Props instance.

Returns a Props instance with dispatch and history capabilities.

Example usage:

final props = useDvaProps(namespace: 'counter');

// Dispatch an action
props.dispatch(Type('increment'));

// Access navigation history
props.history;

Implementation

Props useDvaProps({String? namespace}) {
  return use(
    _DvaPropsHook(
      namespace: namespace,
    ),
  );
}