My app index start with:
ReactDOM.render(
<Provider store={store}>
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Main} />
<Route path="/search" component={MovieSearch} />
<Route path="/movies" component={MovieList} />
</Route>
</Router>
</Provider>,
document.getElementById('root')
);
My Main.js:
render() { return (<div>{this.props.children}</div> )}
When I access URI: /movies MovieList props stay undefined until I connect the component to the store. Is this correct? I need to connect every component to the store to access state? I can't get props from Main parent props without this?
I really need to call mapStateToProps and sometimes mapDispatchToProps to access state and actions ?
This is the default/good practice?