ERROR in src/App.tsx:142:16
TS2345: Argument of type ‘(prev: TreeItems) => (TreeItem | { id: string; value: string; url: string; type: “pdf” | … 3 more … | “jpeg”; })[]’ is not assignable to parameter of type ‘SetStateAction<TreeItems>’.
Type ‘(prev: TreeItems) => (TreeItem | { id: string; value: string; url: string; type: “pdf” | … 3 more … | “jpeg”; })[]’ is not assignable to type ‘(prevState: TreeItems) => TreeItems’.
Type ‘(TreeItem | { id: string; value: string; url: string; type: “pdf” | “link” | “png” | “jpg” | “jpeg”; })[]’ is not assignable to type ‘TreeItems’.
Type ‘TreeItem | { id: string; value: string; url: string; type: “pdf” | “link” | “png” | “jpg” | “jpeg”; }’ is not assignable to type ‘TreeItem’.
Type ‘{ id: string; value: string; url: string; type: “pdf” | “link” | “png” | “jpg” | “jpeg”; }’ is not assignable to type ‘TreeItem’.
Type ‘{ id: string; value: string; url: string; type: “pdf” | “link” | “png” | “jpg” | “jpeg”; }’ is missing the following properties from type ‘MinimalTreeItemData’: parentId, displayName
140 | };
141 |
142 | setItems((prev) => […prev, item]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
143 | };
144 | reader.readAsDataURL(file);
145 | setDropdownMenu(false);
Hello Guys can any one of you please explain me why i am facing this issue
Manish Verma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.