You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rendering something simple similar to the demo using typescript (.tsx file):
1.constNewComponent: React.FC=()=>{2.constsubheadingRef=useRef<HTMLElement>(null);3.constisOpen=false;// Some selector or hook would normally go here4.5.return(6.<div>7.<h1>Heading</h1>
8.<h3ref={subheadingRef}/>9.<Portalcontainer={subheadingRef}>10.{isOpen&&<>Subheading</>}
11.</Portal>12.</div>13.);14.};
An error on line 9 appears: Type 'false | Element' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'. Type 'false' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'.
It seems that the typing for the <Portal /> children differs from the documentation and the corresponding .d.ts declarations exported.
The text was updated successfully, but these errors were encountered:
When rendering something simple similar to the demo using typescript (.tsx file):
An error on line 9 appears:
Type 'false | Element' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'. Type 'false' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'.
It seems that the typing for the
<Portal />
children differs from the documentation and the corresponding.d.ts
declarations exported.The text was updated successfully, but these errors were encountered: