diff --git a/jest.config.js b/jest.config.js index 9c7d60a..3cb4f60 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,5 +7,6 @@ module.exports = { modulePaths: ['/src', '/node_modules'], moduleNameMapper: { '@microstates/react': '/dist/@microstates/react.umd.js' - } + }, + testURL: 'http://localhost' }; diff --git a/src/microstates.js b/src/microstates.js index 42faa42..55d4e50 100644 --- a/src/microstates.js +++ b/src/microstates.js @@ -50,7 +50,8 @@ export default class Microstates extends PureComponent { this._firstUpdate = false; } else { this.setState({ value }); - this.props.onChange(value.state); } + this.props.onChange(value.state); + } } render() {