Starting a React Project

Our project for this chapter, and for the remainder of the book, will be a carousel component. Carousels have become ubiquitous on the web, yet many implementations fall short in various ways. By building your own, you’ll be able to adapt it to your project’s needs.

Create a new directory called test-driven-carousel and opening it in VS Code:

 $ ​​mkdir​​ ​​test-driven-carousel/
 $ ​​code​​ ​​test-driven-carousel/

Use VS Code’s “Git: Initialize Repository” command, or run

 $ ​​git​​ ​​init

on the command line. Once the repo is initialized, add the .gitignore from the previous chapter:

 node_modules/
 .vscode/

Then create a package.json using npm:

 $ ​​npm​​ ​​init​​ ​​-y

As in the previous chapters, ...

Get Test-Driven React now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.