June 2016
Intermediate to advanced
910 pages
18h 59m
English
The TweetList component renders a list of tweets. Each tweet is a Tweet component that a user can click on to remove it from a collection. Does it sound like it could make use of CollectionActionCreators to you?
That's right, let's add the CollectionActionCreators module to it:
var CollectionActionCreators = require('../actions/CollectionActionCreators');Then, we create the removeTweetFromCollection() callback function that will be called when a user clicks on a tweet image:
removeTweetFromCollection: function (tweet) {
CollectionActionCreators.removeTweetFromCollection(tweet.id);
},As you can see, it creates a new action through the removeTweetFromCollection() function by passing the tweet ID to it as an argument. ...
Read now
Unlock full access