Home > @theatre/react > usePrismWithoutReRender

usePrismWithoutReRender() function

This makes sure the prism derivation remains hot as long as the component calling the hook is alive, but it does not return the value of the derivation, and it does not re-render the component if the value of the derivation changes.

Use this hook if you plan to read a derivation in a useEffect() call, without the derivation causing your element to re-render.

Signature:

export declare function usePrismWithoutReRender<T>(fn: () => T, deps: unknown[]): IDerivation<T>;

Parameters

Parameter Type Description
fn () => T
deps unknown[]

Returns:

IDerivation<T>