diff --git a/components/Settings.js b/components/Settings.js index bbbd9ff..75deb04 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -20,7 +20,7 @@ class Settings extends React.Component { } handleClickOutside() { - this.setState({ isVisible: false }); + this.setState({ isVisible: false }) } render() { diff --git a/components/Slider.js b/components/Slider.js index d31f5f1..733ad86 100644 --- a/components/Slider.js +++ b/components/Slider.js @@ -8,7 +8,9 @@ export default class extends React.Component { } handleChange(e) { - this.setState({ value: e.target.value }) + this.setState({ value: e.target.value }, () => { + this.props.onChange(`${this.state.value}px`) + }) } render() { diff --git a/components/Toggle.js b/components/Toggle.js index 4e510e3..4066989 100644 --- a/components/Toggle.js +++ b/components/Toggle.js @@ -9,8 +9,9 @@ export default class extends React.Component { } toggle() { - this.setState({ isEnabled: !this.state.isEnabled }) - this.props.onChange(this.state.isEnabled) + this.setState({ isEnabled: !this.state.isEnabled }, () => { + this.props.onChange(this.state.isEnabled) + }) } render() {