experimental_useEffectEvent
useEffectEvent is a React Hook that lets you extract non-reactive logic into an Effect Event.
const onSomething = useEffectEvent(callback)This API is experimental and is not available in a stable version of React yet.
You can try it by upgrading React packages to the most recent experimental version:
react@experimentalreact-dom@experimentaleslint-plugin-react-hooks@experimentalExperimental versions of React may contain bugs. Don’t use them in production.
useEffectEvent is a React Hook that lets you extract non-reactive logic into an Effect Event.
const onSomething = useEffectEvent(callback)