mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
1.6 KiB
Plaintext
33 lines
1.6 KiB
Plaintext
file.tsx(12,17): error TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes'.
|
|
Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
file.tsx(13,13): error TS2322: Type '{ key: string; children: Element; }' is not assignable to type 'IntrinsicAttributes'.
|
|
Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
file.tsx(14,13): error TS2322: Type '{ key: string; children: Element[]; }' is not assignable to type 'IntrinsicAttributes'.
|
|
Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
|
|
|
|
==== file.tsx (3 errors) ====
|
|
/// <reference path="/.lib/react.d.ts" />
|
|
|
|
import React = require('react');
|
|
|
|
const Tag = (x: {}) => <div></div>;
|
|
|
|
// OK
|
|
const k1 = <Tag />;
|
|
const k2 = <Tag></Tag>;
|
|
|
|
// Not OK (excess children)
|
|
const k3 = <Tag children={<div></div>} />;
|
|
~~~~~~~~
|
|
!!! error TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes'.
|
|
!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
const k4 = <Tag key="1"><div></div></Tag>;
|
|
~~~
|
|
!!! error TS2322: Type '{ key: string; children: Element; }' is not assignable to type 'IntrinsicAttributes'.
|
|
!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
const k5 = <Tag key="1"><div></div><div></div></Tag>;
|
|
~~~
|
|
!!! error TS2322: Type '{ key: string; children: Element[]; }' is not assignable to type 'IntrinsicAttributes'.
|
|
!!! error TS2322: Property 'children' does not exist on type 'IntrinsicAttributes'.
|
|
|