imagine React is building a webpage and painting it on a canvas:

useInsertionEffect(() => {
  const style = document.createElement('style');
  style.textContent = '.my-class { color: red; }';
  document.head.appendChild(style);

  return () => {
    document.head.removeChild(style);
  };
}, []);