A simple convenience hook that creates a reaction with provided expression, effect and options.
Reaction will be created only once (will not be disposed/recreated between renders).
Reaction will be automatically disposed when the component is unmounted.
If this reaction creates other reactions, those reactions will NOT be disposed.
In that case create a reaction manually inside a useEffect hook as described in
mobx-react documentation.
Type parameters
T: unknown
Parameters
expression: (reactionObject: IReactionPublic) => T
A simple convenience hook that creates a reaction with provided
expression
,effect
andoptions
. Reaction will be created only once (will not be disposed/recreated between renders). Reaction will be automatically disposed when the component is unmounted. If this reaction creates other reactions, those reactions will NOT be disposed. In that case create a reaction manually inside auseEffect
hook as described in mobx-react documentation.