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

476
Views
Import dynamic a typescript file in Next JS

According NextJs documentation we can use dynamic import for javascripts filesconst DynamicComponent = dynamic(() => import('../components/hello')).
Will be correct to use dynamic import also for .tsx file like this:

const MyComponent = dynamic(() => import('main/my-file.tsx'), {
  ssr: false,
});

? Or we can import dynamically only .js files?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I guess you can dynamically import ts files in nextjs with some workarounds.

import dynamic from "next/dynamic";
...
...
const Button = dynamic(() => import("../components/Button").then(module => module.default));

If you want to read further https://github.com/vercel/next.js/issues/4515

about 4 years ago · Juan Pablo Isaza Report
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!