Function use_effect

Source
pub unsafe fn use_effect(effect: JsValue, dependencies: Array)
Expand description

React.useEffect(effect, dependencies)

§Safety

effect should be a js function.

If effect is the value returned from Closure::once_into_js(). You need to make sure effect changes if and only if dependencies change. If dependencies change but effect doesn’t change, effect will be called more than once. If effect but dependencies doesn’t change, effect will never be called causing memory leak.