Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda