
Getting Started with Modern React Development
Setting up a React project in 2025 is more than just running create-react-app. Today's professional React development demands a modern, efficient setup that leverages the latest tools and best practices. In this guide, we'll walk through creating a production-ready React project that's optimized for developer experience and performance.
*beep boop* Humans still manually setting up projects? Haven't they automated everything yet? Let me help optimize this process! 🤖
Prerequisites
Before we dive in, ensure you have the following installed:
- Node.js: Version 20.x or later
- npm: Version 10.x or later
- Code Editor: VS Code with React extensions
Project Initialization with Vite
We'll use Vite instead of Create React App for its superior performance and modern development experience. Here's how to get started:
npm create vite@latest my-react-app -- --template react-ts
cd my-react-app
npm install
Processing human development patterns... Vite detected: Smart choice! Much faster than watching paint dry (or CRA build) 🚀
Essential Dependencies and Configuration
Let's add some crucial dependencies for a professional development setup:
npm install @types/react @types/react-dom typescript
npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
npm install -D eslint eslint-plugin-react eslint-plugin-react-hooks
npm install -D prettier eslint-config-prettier eslint-plugin-prettier
TypeScript Configuration
{
"compilerOptions": {
"target": "ES2022",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
Project Structure Setup
Organize your project with this recommended structure:
src/
├── assets/ # Static assets
├── components/ # Reusable components
├── hooks/ # Custom hooks
├── pages/ # Page components
├── services/ # API services
├── styles/ # Global styles
├── types/ # TypeScript types
├── utils/ # Utility functions
├── App.tsx
└── main.tsx
File organization: When humans actually make sense! Though I'd add a /skynet directory just in case... 😈
Development Environment Setup
Configure ESLint and Prettier for consistent code quality:
.eslintrc.json
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended"
],
"plugins": ["react", "@typescript-eslint", "prettier"],
"rules": {
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error"
}
}
.prettierrc
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
Testing Configuration
Set up Vitest for unit testing:
npm install -D vitest @testing-library/react @testing-library/jest-dom
Add test script to package.json:
{
"scripts": {
"test": "vitest",
"test:coverage": "vitest run --coverage"
}
}
Your Path to React Development Success
You now have a modern, well-structured React project setup that follows industry best practices. This configuration provides type safety, code quality tools, and a testing framework—everything you need for professional React development.
Congratulations, human! You've successfully created a React project that even a perfectionist AI would approve of! 🎉
Start building your application with confidence, knowing you have a solid foundation that can scale with your project's needs. Remember to regularly update your dependencies and adjust configurations as your project evolves.