started · updated
TypeScript and React encounter type-checking discrepancies
Developers have identified issues regarding how TypeScript handles React children types. In certain configurations, TypeScript may fail to catch errors when arbitrary objects are passed as children, which can lead to runtime crashes in the browser with errors such as ‘Objects are not valid as a React child’.
The issue has been attributed to specific lines within the React types provided by DefinitelyTyped that can disable comprehensive type checking for children. However, updates to React 18 have reportedly addressed many of these specific type-related problems.