Skip to content
Permalink
Browse files

Modify state when getting items from action cable.

  • Loading branch information...
alexventuraio committed Apr 15, 2019
1 parent eb58a20 commit 994a418db42b3afa6fc96bfd08b21492e94a69db
Showing with 5 additions and 4 deletions.
  1. +5 −4 todolist-react/src/components/App.js
@@ -33,12 +33,13 @@ class App extends Component {
body: JSON.stringify({description: this.state.itemInput})
});

handleReceivedItems = response => {
const { item } = response;

this.setState({
itemInput: '',
items: [...this.state.items, { description: this.state.itemInput }]
items: [...this.state.items, item]
});
console.info("onSubmit: ", this.state)
}
};

render() {
return (

0 comments on commit 994a418

Please sign in to comment.
You can’t perform that action at this time.