h_a86 h_a86 -4 years ago 99
React JSX Question

Using spread operator from es6 in react-redux app with stage-2 loader

I am using ES6 spread operator in my react-redux app like this way

var defaultState = {val:1, items:[]};
export default function(state=defaultState, action){
case 'ADD_BOOK':
state.val = 0;
return {

The problem is each time I get fresh data from
assigned to items. I want to have concatenated data from previous state. Can someone help.

Answer Source

This should work.

return {
  items: [
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download