How to hang properties on built-in objects in Tyepscript?

problem description

when traversing ReactChildren with React.Children.forEach, you need to determine the type of child based on the attribute you hang, but writing child.type directly will cause an error: the attribute "type" does not exist on the
[ts] type "ReactChild".
clipboard.png

tried to define interface, but to no avail.

interface ReactChild{
  type: string;
}

seek the answer of the Great God

Oct.11,2021

first of all, the parameter is an attribute that can be defined

...forEach((child: ReactChild) => {  
     
})

then you can also define the attribute type directly

(child as ReactChild).type
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d1bb-408f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d1bb-408f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?