Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!