Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c547dba

Browse files
added sCU
1 parent 8ecd67f commit c547dba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎src/CheckboxGroup.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ type CheckboxGroupPropsT = {
1313
};
1414

1515
type CheckboxGroupStateT = {
16+
name?: string,
17+
onChange?: (e: SyntheticEvent<HTMLInputElement>, values: Array<string>) => void,
1618
values: string[],
1719
};
1820

@@ -43,7 +45,7 @@ export default class CheckboxGroup extends React.Component<
4345
}
4446
}
4547

46-
constructor(props, state) {
48+
constructor(props: CheckboxGroupPropsT, state: CheckboxGroupStateT) {
4749
super(props, state);
4850
this.state = {
4951
...this.state,
@@ -56,6 +58,13 @@ export default class CheckboxGroup extends React.Component<
5658
name: this.props.name,
5759
};
5860

61+
shouldComponentUpdate(nextProps: CheckboxGroupPropsT, nextState: CheckboxGroupStateT) {
62+
if (this.props !== nextProps || this.state !== nextState) {
63+
return true;
64+
}
65+
return false;
66+
}
67+
5968
removeValue = (value: string, originalEvent: SyntheticEvent<HTMLInputElement>) => {
6069
this.setState(
6170
(state) => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /