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

117
Views
Importing a variable from dynamically imported component

I have a (Map) component dynamically imported to my page.

const Map = dynamic(() => import('../components/Mapcomp'), { ssr: false, })

From that component I also want to import a variable.

const [taskImg, setTaskImg] = useState(null);


export {taskImg};

The component is dynamically imported because otherwise I get a window is not defined error, and this is the solution for that. Same with the variable. If I want to import it I get the above error. But I need to use the taskImg variable in this page. How can I do that?

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

0

You can't export a state to another component you either need to use a state management library like redux or create a context which make the state available for all the other components

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!