File: checkJsxChildrenProperty15.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (31 lines) | stat: -rw-r--r-- 1,724 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tests/cases/conformance/jsx/file.tsx(10,17): error TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes'.
  Property 'children' does not exist on type 'IntrinsicAttributes'.
tests/cases/conformance/jsx/file.tsx(11,13): error TS2322: Type '{ children: Element; key: string; }' is not assignable to type 'IntrinsicAttributes'.
  Property 'children' does not exist on type 'IntrinsicAttributes'.
tests/cases/conformance/jsx/file.tsx(12,13): error TS2322: Type '{ children: Element[]; key: string; }' is not assignable to type 'IntrinsicAttributes'.
  Property 'children' does not exist on type 'IntrinsicAttributes'.


==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
    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 '{ children: Element; key: string; }' 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 '{ children: Element[]; key: string; }' is not assignable to type 'IntrinsicAttributes'.
!!! error TS2322:   Property 'children' does not exist on type 'IntrinsicAttributes'.