From 5ab0b9ead97f678a9f961381635cf470d966d768 Mon Sep 17 00:00:00 2001 From: Jordy Date: Mon, 29 Jun 2020 13:58:07 +0200 Subject: [PATCH] Skip checking if key exists in parent state --- build/index.js | 4 +--- src/index.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build/index.js b/build/index.js index 87ea0eb..ba8ae60 100644 --- a/build/index.js +++ b/build/index.js @@ -314,9 +314,7 @@ var SimpleStorage = function (_Component) { // update parent's state with the result // store.js handles parsing - if (name in parent.state) { - parent.setState(_defineProperty({}, name, value)); - } + parent.setState(_defineProperty({}, name, value)); } }); diff --git a/src/index.js b/src/index.js index cd0c937..eaa2c9f 100644 --- a/src/index.js +++ b/src/index.js @@ -76,9 +76,7 @@ export default class SimpleStorage extends Component { // update parent's state with the result // store.js handles parsing - if (name in parent.state) { - parent.setState({ [name]: value }); - } + parent.setState({ [name]: value }); } });