Merge pull request #20987 from pelotom/patch-10

[react] Make component constructor props non-optional
This commit is contained in:
Igor Oleinikov
2017-11-08 13:58:44 -08:00
committed by GitHub
19 changed files with 44 additions and 34 deletions

View File

@@ -30,7 +30,7 @@ type SyntheticKeyboardEvent = React.KeyboardEvent<{}>;
class RichEditorExample extends React.Component<{}, { editorState: EditorState }> {
constructor() {
super();
super({});
const sampleMarkup =
'<b>Bold text</b>, <i>Italic text</i><br/ ><br />' +
@@ -182,9 +182,17 @@ function getBlockStyle(block: ContentBlock) {
}
}
class StyleButton extends React.Component<{key: string, active: boolean, label: string, onToggle: (blockType: string) => void, style: string}> {
constructor() {
super();
interface Props {
key: string
active: boolean
label: string
onToggle: (blockType: string) => void
style: string
}
class StyleButton extends React.Component<Props> {
constructor(props: Props) {
super(props);
}
onToggle: (event: Event) => void = (event: Event) => {