@zedux/react
Version:
A Molecular State Engine for React
14 lines (13 loc) • 704 B
TypeScript
/**
* Get a unique id for a Zedux hook call. This id is predictable - it should be
* exactly the same every time a given component renders in the same place in
* the component tree. This means it persists across component
* destruction/recreation which happens a lot e.g. during suspense.
*
* This uses the forbidden React internals object. We only use it to get a
* dev-friendly name for the React component's node in the atom graph. It's fine
* if React changes their internals - we'll fall back to the string "rc" ("React
* Component"). We have no need to "warn users they cannot upgrade" 'cause they
* can at the cost of some DX.
*/
export declare const useReactComponentId: () => string;