Book Image

React.js Essentials

By : Artemij Fedosejev
Book Image

React.js Essentials

By: Artemij Fedosejev

Overview of this book

Table of Contents (18 chapters)
React.js Essentials
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using another library in your React component


As we discussed earlier in this book, our Snapterest web application will consume a live stream of tweets. In Chapter 1, Installing Powerful Tools for Your Project, you installed the Snapkite Engine library that connects to the Twitter Streaming API, filters the incoming tweets, and sends them to our client application. In turn, our client application needs a way of connecting to that live stream and listening for the new tweets.

Luckily, we don't need to implement this functionality ourselves because we can reuse another Snapkite module called snapkite-stream-client. Let's install this module.

Navigate to the ~/snapterest directory and run the following command:

npm install --save snapkite-stream-client

It will install the snapkite-stream-client module, and add it to package.json as a dependency.

Now we're ready to reuse the snapkite-stream-client module in one of our React components.

In the previous chapter, we created the Application component...