tss-react
Version:
Type safe CSS-in-JS API heavily inspired by react-jss
20 lines (19 loc) • 581 B
TypeScript
/**
* useEffect(
* ()=> { ... },
* [ { "foo": "bar" } ]
* )
* => The callback will be invoked every render.
* because { "foo": "bar" } is a new instance every render.
*
* useEffect(
* ()=> { ... },
* [ getDependencyArrayRef({ "foo": "bar" }) ]
* );
* => The callback will only be invoked once.
*
* The optimization will be enabled only if obj is
* of the form Record<string, string | number | undefined | null>
* otherwise the object is returned (the function is the identity function).
*/
export declare function getDependencyArrayRef(obj: any): any;