Create Your First React App
Step 1: Install
React requires Node.js and npm. If you haven't already got them, install them first.
npx create-react-app my-app cd my-app npm start
This command will create a new React app with a modern development setup.
You can also add TypeScript support with --template typescript
if you prefer.
Step 2: Create Your App
The app scaffold includes everything you'll need. You can start building UI
right away in the src/
folder.
function App() { return ( <div className="App"> <h1>Welcome to React!</h1> </div> ); } export default App;
This simple component renders a heading to the page. You can customize this with your own components and styles.
Key Concepts
Components
Build encapsulated components that can be reused and composed to render complex UIs.
JSX
Use a syntax extension that looks a lot like HTML to define what the UI should look like.
State
Keep track of component state over time using useState
and useEffect
hooks.
Need Help?
The React community is here to help! If you run into any issues or questions, explore our resources and support channels.
React Discussions
Ask questions and share knowledge with the community on our public forum.
View DiscussionsGitHub Issues
If you found a bug or have a feature request, submit an issue on our public GitHub repo.
Report IssueReact DevTool
Debug components, inspect props and state, and profile react apps performance.
Learn MoreStart Building Today
Join millions of developers using React to create amazing apps and websites.