View is not updated


(coolshare) #1

The react view is not updated (the render is never called) but the reducer was invoked.

I have the following:

1). the react view: I a field in the root state to determent if I need to show “TodoList” or “HousingInfo”

export default class RightPane extends React.Component{
static contextTypes = {
store: React.PropTypes.object
}

render(){
let store = this.context.store;
let curPage = store.getState()[“mainRightPanePage”].currentPage;
return (
<div>
{(store.getState()[“mainRightPanePage”].currentPage===“TodoList”) && <TodoList/>}
{(store.getState()[“mainRightPanePage”].currentPage===“HousingInfo”) && <HousingInfo/>}
</div>
)
}
}

2). the action dispatching

store.dispatch({‘type’:‘switchPage’, ‘pageId’:pageId});

3). the reducer: the following reducer was invoked

const mainRightPanePage = (state = {‘currentPage’:‘TodoList’}, action) => {
switch (action.type) {
case ‘switchPage’:
return Object.assign({}, state, {
currentPage: action.pageId
})
default:
return state
}
}

export default mainRightPanePage

What did I miss?

thanks


(danoise) #2

Hey, I think you’re looking for support for react, not renoise redux?

But do take a look around :slight_smile:


(boonier) #3

haha I thought, hold on, that looks familiar…wait a minute!