@zedux/react
Version:
A Molecular State Engine for React
24 lines (23 loc) • 826 B
TypeScript
import { AnyAtomInstance } from '@zedux/atoms';
import { ReactElement, ReactNode } from 'react';
/**
* Provides an atom instance over React context.
*
* Provided atom instances can be consumed in child components via
* `useAtomContext()`. The atom instance can then be passed to other hooks like
* `useAtomValue()` or `useAtomState()` to create a dynamic dependency on the
* consumed instance.
*
* The providing component should typically register at least a static
* dependency on the provided instance via `useAtomInstance()` or manual
* graphing inside `useEffect()`.
*/
export declare const AtomProvider: (props: {
children?: ReactNode;
instance: AnyAtomInstance;
instances?: undefined;
} | {
children?: ReactNode;
instance?: undefined;
instances: AnyAtomInstance[];
}) => ReactElement;