forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckJsxChildrenProperty1.js
More file actions
44 lines (38 loc) · 919 Bytes
/
checkJsxChildrenProperty1.js
File metadata and controls
44 lines (38 loc) · 919 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
//// [tests/cases/conformance/jsx/checkJsxChildrenProperty1.tsx] ////
//// [file.tsx]
/// <reference path="/.lib/react.d.ts" />
import React = require('react');
interface Prop {
a: number,
b: string,
children: string | JSX.Element
}
function Comp(p: Prop) {
return <div>{p.b}</div>;
}
// OK
let k = <Comp a={10} b="hi" children ="lol" />;
let k1 =
<Comp a={10} b="hi">
hi hi hi!
</Comp>;
let k2 =
<Comp a={10} b="hi">
<div>hi hi hi!</div>
</Comp>;
//// [file.jsx]
"use strict";
/// <reference path="/.lib/react.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
function Comp(p) {
return <div>{p.b}</div>;
}
// OK
var k = <Comp a={10} b="hi" children="lol"/>;
var k1 = <Comp a={10} b="hi">
hi hi hi!
</Comp>;
var k2 = <Comp a={10} b="hi">
<div>hi hi hi!</div>
</Comp>;