Here is the fastest way to create a Next.js React app with TypeScript. For the step-by-step version, take a look at the longer version.
Let's use npx and create-next-app
.
npx \
create-next-app nextjs-app \
--use-npm \
--example \
"https://github.com/nonoesp/next-learn/tree/master/basics/typescript-final"
# Enter the app's directory
cd nextjs-app
# Run the app in development
npm run dev
# ready - started server on 0.0.0.0:3000, url: http://localhost:3000
You should be able to access the site at http://localhost:3000.
npm run build
npm start
# ready - started server on 0.0.0.0:3000, url: http://localhost:3000
You can watch my step-by-step video on How to build a Next.js app with React & TypeScript.