Experience-Monks/nextjs-boilerplate

[Bug] React-transition-group glitch bug

DonghyukJacobJang opened this issue · 2 comments

Added this on the project initialization in order to fix this issue:

      // Fix https://github.com/vercel/next.js/issues/17464
      document
        .querySelectorAll('head > link[rel="stylesheet"][data-n-p]')
        .forEach((node) => node.removeAttribute('data-n-p'));
      new MutationObserver((mutations) => {
        mutations.forEach(({ target }) => {
          const t = target as Element;
          if (t.nodeName === 'STYLE' && t.getAttribute('media') === 'x') t.removeAttribute('media');
        });
      }).observe(document.head, { subtree: true, attributeFilter: ['media'] });

Let's add this to a list of gotchas. Should not be a part of the Boilerplate.