I'm currently starting to learn ReactJS and have run into some trouble updating an array.
Currently I have a searchable list of contacts which is working fine. But using the input box below the list I am trying to add additional items to the list using the update() function.
Sample of what I've got so far for the update function is below. Ideally at some point the updated content would come from the input box to the left of the button, but currently I'm just trying to push a static item as a test.
updateContact: function(e){
e.preventDefault();
var newItems = React.addons.update(this.state.initialItems, {$push: ["New Item"]})
return;
},
Any help or direction would be greatly appreciated, and a full JSFiddle with the entire code can be found below.