How to Create a React App With React Query Builder Using npm

Setting up the application and adding a query builder

Table of Contents

Setup#

To get started building the application, we'll need to bootstrap it with Create React App. Create React App is a tool that helps initialize React projects and it's one of the quickest ways to get started writing a React application.

Start by making a myapp directory and changing into that directory:

Next, initialize a git repository within that directory.

Then run the npx command to generate a new React application using Create React App in a folder called client. We'll use the typescript template, and force the use of npm since that's what our remote server will use.

(We do it this way, i.e. myapp/client, to get ready for the full application later.)

Finally, let's add some additional dependencies, react-querybuilder and node-sass.

Once that command is finished, delete the unnecessary files:

  • src/setupTests.ts

  • src/App.test.tsx

  • src/logo.svg

  • src/reportWebVitals.ts

  • public/favicon.ico

  • public/logo*.png

  • public/manifest.json

  • public/robots.txt

This lesson preview is part of the Building Advanced Admin Reporting in React course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

Unlock This Course

Get unlimited access to Building Advanced Admin Reporting in React, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course Building Advanced Admin Reporting in React