mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* add required property children to Props * name function arguments for onCopy * put required props before optional * make all Options attributes optional and add format * extend and add tests * indicate lib version for these types and add contributor
25 lines
688 B
TypeScript
25 lines
688 B
TypeScript
import * as React from "react";
|
|
import CopyToClipboard = require("react-copy-to-clipboard");
|
|
|
|
export class OnlyRequiredProps extends React.Component {
|
|
render() {
|
|
return (
|
|
<CopyToClipboard text={"Hello World"}>
|
|
<button>Copy to clipboard with button</button>
|
|
</CopyToClipboard>
|
|
);
|
|
}
|
|
}
|
|
|
|
export class AllProps extends React.Component {
|
|
render() {
|
|
return (
|
|
<CopyToClipboard text={"Hello World"}
|
|
onCopy={() => {}}
|
|
options={{debug: true, message: "message", format: "text/plain"}}>
|
|
<span>Copy to clipboard with span</span>
|
|
</CopyToClipboard>
|
|
);
|
|
}
|
|
}
|