From 808344eecfedd04149551867724e46a7988c45a0 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 30 Apr 2019 09:03:01 +0900 Subject: Fix React Component tests --- src/settings/components/form/SearchForm.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/settings/components/form/SearchForm.jsx') diff --git a/src/settings/components/form/SearchForm.jsx b/src/settings/components/form/SearchForm.jsx index 718cca1..2e070fc 100644 --- a/src/settings/components/form/SearchForm.jsx +++ b/src/settings/components/form/SearchForm.jsx @@ -8,9 +8,6 @@ class SearchForm extends React.Component { render() { let value = this.props.value; - if (!value) { - value = { default: '', engines: []}; - } if (!value.engines) { value.engines = []; } @@ -82,7 +79,10 @@ SearchForm.propTypes = { engines: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string)), }), onChange: PropTypes.func, +}; +SearchForm.defaultProps = { + value: { default: '', engines: []}, }; export default SearchForm; -- cgit v1.2.3