Provider.d.ts 1.4 KB

123456789101112131415161718192021222324252627
  1. import type { Context, ReactNode } from 'react';
  2. import type { ReactReduxContextValue } from './Context';
  3. import type { Action, AnyAction, Store } from 'redux';
  4. import type { CheckFrequency } from '../hooks/useSelector';
  5. export interface ProviderProps<A extends Action = AnyAction, S = unknown> {
  6. /**
  7. * The single Redux store in your application.
  8. */
  9. store: Store<S, A>;
  10. /**
  11. * An optional server state snapshot. Will be used during initial hydration render if available, to ensure that the UI output is consistent with the HTML generated on the server.
  12. */
  13. serverState?: S;
  14. /**
  15. * Optional context to be used internally in react-redux. Use React.createContext() to create a context to be used.
  16. * If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider.
  17. * Initial value doesn't matter, as it is overwritten with the internal state of Provider.
  18. */
  19. context?: Context<ReactReduxContextValue<S, A>>;
  20. /** Global configuration for the `useSelector` stability check */
  21. stabilityCheck?: CheckFrequency;
  22. /** Global configuration for the `useSelector` no-op check */
  23. noopCheck?: CheckFrequency;
  24. children: ReactNode;
  25. }
  26. declare function Provider<A extends Action = AnyAction, S = unknown>({ store, context, children, serverState, stabilityCheck, noopCheck, }: ProviderProps<A, S>): JSX.Element;
  27. export default Provider;