Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
Importing different Components from same library dynamically & non-dynamically? [Next.JS]

I am trying to wrap my head around how these things work / how to think about this. Say I have these 2 imports in my next.js project:

import components, { MDXWrapper } from '@/components/MDXComponents';

Would it help to refactor it dynamically like so with just one of them? :

import dynamic from 'next/dynamic';

import { MDXWrapper } from '@/components/MDXComponents';
const components = dynamic(() => import('@/components/MDXComponents'));

Or will this not help the bundle size / page load at all, since MDXWrapper is still imported the old way? How should I think about this? Is it the component level that counts here or is it the package level that I should be thinking about? Will doing import { MDXWrapper } from '@/components/MDXComponents'; still import the whole file all the same, jinxing my dynamic import?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda