пропс обновляется, store обновляется, connect есть
storage7.static.itmages.com/i/17/0217/h_1487344158...
а внутри компонента props изначальный.
кусочек компонентаclass ContentControlPage extends React.Component{
constructor(props) {
super(props);
this.state = {
displayedTransport: this.props.transport_list
}
this.fix_it = this.fix_it.bind(this);
}
componentWillMount() {
actionCreators.update_Transport_List(TRANSPORT_INFO);
console.log('store - componentWillMount:', store.getState());
console.log('props - componentWillMount:', this.props.transport_list);
this.setState({
displayedTransport: this.props.transport_list
})
}
handleSearch = (inputValue) => {
let searchQuery = inputValue.toLowerCase();
let newelement = 'false';
let displayedTransport = TRANSPORT_INFO.filter(function(el){
let searchValue = el.name.toLowerCase();
let currentPlace = el.current_place;
return searchValue.indexOf(searchQuery) !== -1;
});
this.setState({
displayedTransport: this.props.transport_list,
});
}
fix_it(event){
console.log('props transport_list', this.props.transport_list)
}
render(){...
connectfunction update_Transport_List(data){
store.dispatch({
type : 'UPDATE_TRANSPORT_LIST',
transport_list : data,
})
console.log('after_dispatch', store.getState())
}
const actionCreators = {
update_Transport_List: update_Transport_List,
};
let ContentControlPageController = connect(
state => ({
transport_list: state.controlR.transport_list
}),
dispatch => bindActionCreators({
actionCreators,
},dispatch )
)(ContentControlPage)
export default ContentControlPageController;