-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to initiate gantt chart declarative way? #28
Comments
I finally found the problem. It's the package 'ibm-gantt-chart-react'. |
Here https://github.com/IBM/gantt-chart/tree/master/packages/ibm-gantt-chart-react is an example of how to use the Gantt component in React |
I'm having the same issue under different circumstances. It seems to be tied to how many times the parent component renders. In my situation I'm passing the data from a react hook that loads the data from an api. However, it seems the data is changing so it has to re-render the parent component and then instantiates a new GanttChart when it does that with the updated data instead of updating the existing GanttChart. |
I had to change my code like so: import { GanttChart } from 'ibm-gantt-chart-react';
import 'ibm-gantt-chart/dist/ibm-gantt-chart.css'; Since this package doesn't have associated TypeScript typings, I also had to add |
I have personal project to practice my js skill. I found this repo and i'm interested to give a try.
I want to make a component that contain gantt chart. I tried this code below. But it was rendered and duplicated.
I also tried with declarative way like the code below
I use both ways inside a parent component like this :
When i use the first one, gantt chart was successfuly rendered but it duplicates several times
here is the result :
When i use the second one, gantt chart was not rendered and threw an error
The text was updated successfully, but these errors were encountered: