Anybody had success implementing Highcharts? #8153
Replies: 2 comments 3 replies
-
Here's a StackBlitz https://stackblitz.com/edit/remix-run-remix-xnlpw8?file=app%2Froutes%2F_index.tsx |
Beta Was this translation helpful? Give feedback.
3 replies
-
Import import HighchartsReact from "highcharts-react-official";
import Highcharts from 'highcharts'; Use CSR (Client Side Rendering) const [isClient, setIsClient] = useState(false);
useEffect(() => {
setIsClient(true);
}, []); Return function return (
<>
{
isClient ? (
<HighchartsReact highcharts={Highcharts}/>
) : null
}
</>
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there. First time trying out Remix for a new project.
I'm trying to add Highcharts to my Remix project but I can't get it working. The following error is thrown:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
I think the issue could be due to Remix trying to render this code on the server, but even forcing client-side rendering/bundling, the app returns the error above.
Does anybody had success implementing Highcharts in Remix?
I've also tried using
chart.client.jsx
along withClientOnly
for the Chart component, but no success. Also tried rendering everything on the server, but also couldn't get it to work. Also tried searching stackoverflow/github for any previous attempt to make Highcharts work with Remix, but couldn't find anything.What am I doing wrong? Any advices towards the right path? Thank you in advance.
Here's the code:
root.jsx
chart.jsx
remix.config.cjs
Beta Was this translation helpful? Give feedback.
All reactions