use-insertion-effect This is not the package you are looking for. You should install react>=18 and use: import { useInsertionEffect } from 'react'