KNOWe Learning Module

Learn React.js

Build modern, component-based user interfaces with React.js

Why Learn React.js?

Component Based

React organizes interfaces into reusable components.

Industry Standard

Widely used in modern frontend development by top companies.

Project Setup

A React project can be created with tools like Vite or Create React App.

npm create vite@latest my-react-app -- --template react
cd my-react-app
npm install
npm run dev
Starts a local React development server at http://localhost:5173

JSX Basics

JSX lets you write HTML-like syntax inside JavaScript. Try it yourself!

Try JSX Code

Output (Console)

Components

Components are reusable pieces of UI. Try creating nested components!

Props (Properties)

Props pass data from parent to child components.

State Management

State stores data that can change over time (useState hook).

// Real React syntax:
const [count, setCount] = useState(0);
<button onClick={() => setCount(count + 1)}>Count: {count}</button>

šŸŽÆ Mini Project: Profile Card Component

React.js Assessment

Test your understanding of React.js fundamentals.

1. React is mainly used to build:
2. What is used to pass data into a component?
3. State can change while the app is running.
Complete the quiz and click submit.

Learner Progress

Track completion of this React.js module.

Course Progress0%

Next Steps

  • āœ“ Practice building small reusable components
  • āœ“ Create forms and counters using useState
  • āœ“ Build a multi-component page layout
  • āœ“ Continue to useEffect, Context API, and React Router
  • āœ“ Learn about fetching data from APIs in React