I am doing a Gantt chart for jobs.
I would like to display a Gantt chart for jobs that I selected.
I use Axios send and receive data from database.
It is ok for the first Gantt chart, but when come to the second one, it failed due to the error:
"The target placeholder was already initialized by another DayPilot component instance."
I know Scheduler has dispose() method, does Gantt has something similar with it?
Sorry, the useEffect hook was wrong, should be this one, the code above just an example~
React.useEffect(() => {
dpg.init();
}, [])
Answer posted by Dan Letecky [DayPilot] 3 years ago.
There is a special React package that defines a <DayPilotGantt> React component which you can use in your JSX instead of creating the instance manually using a placeholder and init() method.
Thank you very much for your help!
The old app I am maintaining was not created by "npx create-react-app xxx" :(
I only added React for the new page of the app.
Using "import {DayPilotGantt} from "daypilot-pro-react"; does not work, and I have not found a proper way to make it work (just started learning React), maybe I need to config webpack myself?
So that why I created the instance manually.
Thank you again for your help ;)
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.