aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-12-10 01:07:11 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-12-10 01:07:11 +0100
commitb7fab958633456346d67c9cdd68eef05572882ab (patch)
tree5f2911bbfd1445e7d8ff9a285ec1ac441806967d /src/client
parent4ce420528dd747021f7fa51483710388f5733724 (diff)
Add redux devtools support
Diffstat (limited to 'src/client')
-rw-r--r--src/client/react/components/container/Search.js1
-rw-r--r--src/client/react/components/presentational/Search.js4
-rw-r--r--src/client/react/index.js7
3 files changed, 10 insertions, 2 deletions
diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js
index 1b5a41d..0722128 100644
--- a/src/client/react/components/container/Search.js
+++ b/src/client/react/components/container/Search.js
@@ -4,6 +4,7 @@ import PresentationalSearch from '../presentational/Search';
const mapStateToProps = state => ({
results: state.searchResults,
+ value: state.searchInput,
});
const mapDispatchToProps = dispatch => ({
diff --git a/src/client/react/components/presentational/Search.js b/src/client/react/components/presentational/Search.js
index ce4a09d..f75e612 100644
--- a/src/client/react/components/presentational/Search.js
+++ b/src/client/react/components/presentational/Search.js
@@ -1,10 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
-const Search = ({ onType, results }) => (
+const Search = ({ onType, value, results }) => (
<div>
<input
onChange={onType}
+ value={value}
placeholder="Zoeken"
/>
<ul>
@@ -15,6 +16,7 @@ const Search = ({ onType, results }) => (
Search.propTypes = {
onType: PropTypes.func.isRequired,
+ value: PropTypes.func.isRequired,
results: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string.require,
type: PropTypes.string.require,
diff --git a/src/client/react/index.js b/src/client/react/index.js
index bb7a21b..e1bae3c 100644
--- a/src/client/react/index.js
+++ b/src/client/react/index.js
@@ -5,7 +5,12 @@ import { createStore } from 'redux';
import reducer from './reducers';
import App from './App';
-const store = createStore(reducer);
+/* eslint-disable no-underscore-dangle */
+const store = createStore(
+ reducer,
+ window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
+);
+/* eslint-enable */
ReactDOM.render(
<Provider store={store}>