Open grazielleanna opened 1 year ago
Same problem here, using version 1.0.5
on my end. Any thoughts?
Error:
No overload matches this call.
Overload 1 of 2, '(props: TreeProps | Readonly<TreeProps>): Tree', gave the following error.
Type '{ children: any[]; itemId: string; onItemToggle: () => Promise<void>; key: number; content: any; springConfig: (open: any) => { from: { height: number; opacity: number; transform: string; }; to: { ...; }; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Tree> & Readonly<TreeProps>'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Tree> & Readonly<TreeProps>'.
Overload 2 of 2, '(props: TreeProps, context: any): Tree', gave the following error.
Type '{ children: any[]; itemId: string; onItemToggle: () => Promise<void>; key: number; content: any; springConfig: (open: any) => { from: { height: number; opacity: number; transform: string; }; to: { ...; }; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Tree> & Readonly<TreeProps>'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Tree> & Readonly<TreeProps>'.ts(2769)
(alias) class Tree
import Tree
Code:
<Tree itemId={i.toString()} onItemToggle={async () => await fetchSelectedActionConnectionsAndPolicies(action)} key={i} content={action.toJSON().name} springConfig={config}>
The issue appears after upgrading from React 17 to React 18, and can be ignored until the library typing is updated, like so:
// @ts-expect-error library typing needs to be updated for React 18
<Tree ...>
Hi!
When using the library with typescript the following error occurs: No overload matches this call. Overload 1 of 2, '(props: TreeProps | Readonly): Tree', gave the following error.
Type '{ children: Element[]; content: string; type: string; canHide: true; open: true; style: { position: string; top: number; left: number; color: string; fill: string; width: string; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Overload 2 of 2, '(props: TreeProps, context: any): Tree', gave the following error.
Type '{ children: Element[]; content: string; type: string; canHide: true; open: true; style: { position: string; top: number; left: number; color: string; fill: string; width: string; }; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'
This my code:
`
`
Any solution to use typescript?