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

187
Views
Render Fushion Charts in React SSR

Is there any way to render fushion charts on server side in react ? . I am getting this ReferenceError: document is not defined error when starting the react app via express server.

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

0

I am guessing here, but if you are using a charting library which relies on functionality only present on the client, for instance window, you could do a simple check if the component has actually mounted. There are many ways of doing this. If you are writing a functional component, you could for instance do:

const [isClient, setIsClient] = useState(false);

useEffect(() => {
  setIsClient(true);
}, [])

return isClient ? (<SomeFusionChart/>) : (<SomePlaceHolder/>

within the functional component, or separate this into a custom hook.

You could also do

(typeof window !== 'undefined') ? (<SomeFusionChart/>) : (<SomePlaceHolder/>
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!