React integration

useInsertionEffect

Client style insertion hook for libraries; no state updates or attached refs.

Formal Syntax & Structure

react syntaxreact
useInsertionEffect(() => { insert(); return remove; }, [insert, remove])

Working Example

Example Snippetreact
useInsertionEffect(() => { insert(); return remove; }, [insert, remove])
React Reference