Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit 24d45fe

Browse files
committed
Use ... in type definitions
1 parent fcb7c7b commit 24d45fe

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

01 - Core/08 - Transferring Props.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
import { HTMLProps, joinClasses } from "react-dom";
1+
import { HTMLPropTypes, joinClasses } from "react-dom";
22

33
// Draft
44

5-
interface FancyButtonProps extends typeof HTMLProps.button {
6-
color: string,
7-
width: number,
8-
height: number
9-
}
10-
115
class FancyButton {
126

137
static defaultProps = {
148
color: 'blue'
159
};
1610

17-
props: FancyButtonProps; // Could this interface be inlined?
11+
props: {
12+
color: string,
13+
width: number,
14+
height: number,
15+
...HTMLPropTypes
16+
},
1817

1918
// This uses rest and spread operators
2019
// https://gist.github.com/sebmarkbage/aa849c7973cb4452c547

0 commit comments

Comments
 (0)