Closed damiangreen closed 5 years ago
Why you need to:
const EchartsReact = typeof document !== 'undefined' && require('echarts-for-react').default;
Use it when ssr?
Do i load LinearGradient
from EchartsReact
also?
Can i only instantiate one of these objects in ComponentDidMount
?
I'm using RSK and I think this line is causing me issues on page reload
const dattoHorizontalGradient = new echarts.graphic.LinearGradient(...)
I manged to get around window.document errors when using the main component by doing tihs:
const EchartsReact = typeof document !== 'undefined' && require('echarts-for-react').default; // eslint-disable-line
...Is there another way of importing gradients I'm unaware of?