How to use Create-React-App without React
Create-React-App is an amazing piece of technology that does everything for you (I don’t drink coffee), but how can you use it without having to integrate React in your app?
Step 1: Use Create-React-App:
npx create-react-app my-app
Step 2: Don’t use React:
// FILE: src/index.js
///////////// Before ////////////
import React from "react";
// ...
///////////// After /////////////
// Anything! Put your browser code here (pure JS, Preact, etc.)
Yup, it just works! You get all the awesome benefits of CRA, including out-of-the-box support for TypeScript, ESLint and Webpack among others, but are free to use it with pure JS, Preact or other libraries.
Running ‘npm run build’ now results in super light build files (until the day on which you’ll import ThatOtherMassiveLibrary™ obviously).