reactjs - Why does react redux does not re render view for object states changes? -
new redux , react , not sure why views not updated when objects in state updated.
see jsbin: https://jsbin.com/wucutuhovu/1/edit?js,output
however works numbers: https://jsbin.com/kaloqanise/1/edit?js,output
redux doing shallow comparison state. when change state.value
, state
still points same object.
try changing state.value += 1
to:
return object.assign({}, state, { value: state.value + 1 });
check out jsbin: https://jsbin.com/cikinocudo/1/edit?js,output
Comments
Post a Comment