~/daniel
Back to Blog

blog/intro-to-react · apr 15, 2025 · ↻ aug 16, 2026 · 2 min read

Intro to React and How to Use It

Learn what React is, why it's popular, and how to create your first component.

React is a JavaScript library for building user interfaces. It makes it easy to create interactive UIs by using a component-based approach.

Why Use React?

  • Reusable components save time and make code cleaner
  • Virtual DOM makes updates faster
  • Strong community and tons of tools

Your First React Component

Let’s create a simple “Hello, World!” component:

function HelloWorld() {
  return <h1>Hello, World!</h1>
}

export default HelloWorld

Setting Up a Project (with Vite)

# Create a new React project with Vite
npm create vite@latest my-app -- --template react

cd my-app
npm install
npm run dev

Core Concepts to Learn

  • JSX: JavaScript + XML syntax
  • Props: Passing data into components
  • State: Managing local component data

Stay curious, and happy coding! 🎯

Note: It’s very easy to find a myriad of tutorials online, but quite frankly, the official React documentation is an excellent resource to learn from. You can find it here: React Docs.

React Docs

$ ls ../related

Other posts that might interest you