Files
tsgo/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty1.js

45 lines
921 B
TypeScript

//// [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 });
const React = require("react");
function Comp(p) {
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>;