Javascript – Error: Cannot read properties of undefined (reading 'id')
My code is: import { type } from '@testing-library/user-event/dist/type'; import React, { useState } from 'react'; import './clint.css' export default function Addtask() { const [task, setTask] = useState([]); const [text, setText] = useState(''); const obj = [{ task: text.trim(), id:…