Propagate event to onChange prop in Switch component
This commit is contained in:
@@ -14,8 +14,7 @@ export interface Props {
|
|||||||
export interface State {
|
export interface State {
|
||||||
id: any;
|
id: any;
|
||||||
}
|
}
|
||||||
|
export class Switch extends PureComponent<Props, State> {
|
||||||
export class Switch extends PureComponent<Props, State> {
|
|
||||||
state = {
|
state = {
|
||||||
id: _.uniqueId(),
|
id: _.uniqueId(),
|
||||||
};
|
};
|
||||||
@@ -23,7 +22,7 @@ export class Switch extends PureComponent<Props, State> {
|
|||||||
internalOnChange = (event: React.FormEvent<HTMLInputElement>) => {
|
internalOnChange = (event: React.FormEvent<HTMLInputElement>) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
this.props.onChange();
|
this.props.onChange(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user