Skip to content
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

Getting errors because states are set to null instead of empty arrays #3

Open
IsakSolenergikvalitet opened this issue Jun 25, 2024 · 0 comments

Comments

@IsakSolenergikvalitet
Copy link

I have converted the GanttChart.js file to a .tsx file to better fit my project’s requirements. However, I encountered errors in the AddTask and TimeTable components when trying to add a task. The application works as intended when the useState hooks for tasks and taskDurations are initialized with empty arrays instead.

const [tasks, setTasks] = useState([]);
const [taskDurations, setTaskDurations] = useState([]);

Steps to Reproduce

1.	Convert Ganttchart.js to Ganttchart.tsx.
2.	Attempt to add a task using the AddTask component.
3.	Observe the errors related to AddTask and TimeTable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant