mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
39 lines
903 B
TypeScript
39 lines
903 B
TypeScript
//// [tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx] ////
|
|
|
|
//// [file.tsx]
|
|
/// <reference path="/.lib/react.d.ts" />
|
|
|
|
import React = require('react');
|
|
|
|
type TextProps = { editable: false }
|
|
| { editable: true, onEdit: (newText: string) => void };
|
|
|
|
class TextComponent extends React.Component<TextProps, {}> {
|
|
render() {
|
|
return <span>Some Text..</span>;
|
|
}
|
|
}
|
|
|
|
// Error
|
|
let x = <TextComponent editable={true} />
|
|
|
|
const textProps: TextProps = {
|
|
editable: false
|
|
};
|
|
|
|
//// [file.jsx]
|
|
"use strict";
|
|
/// <reference path="/.lib/react.d.ts" />
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const React = require("react");
|
|
class TextComponent extends React.Component {
|
|
render() {
|
|
return <span>Some Text..</span>;
|
|
}
|
|
}
|
|
// Error
|
|
let x = <TextComponent editable={true}/>;
|
|
const textProps = {
|
|
editable: false
|
|
};
|