React is one of the most popular JavaScript libraries for building user interfaces, especially single-page applications. Developed and maintained by Facebook, it’s known for its speed, flexibility, and scalability. Whether you’re a beginner starting your frontend journey or a developer wanting to master component-based architecture, React is an essential skill in modern web development.
This guide provides a comprehensive syllabus of React covering all the important topics—structured from beginner to advanced—ideal for self-learners, students, and developers.
1. Introduction to React
- What is React?
- React is a JavaScript library for building fast and interactive UIs.
- It allows developers to build reusable components.
- Why React?
- Virtual DOM
- Component-based structure
- Huge community support
- Used by major companies like Facebook, Instagram, Netflix
- React vs Angular vs Vue
- Comparisons on architecture, learning curve, performance
2. React Setup & Environment
- Installing Node.js and npm
- React apps need Node and npm to manage packages.
- Create React App (CRA)
- Using
npx create-react-app
to quickly scaffold a new project.
- Using
- Understanding Project Structure
public/
,src/
,App.js
,index.js
,package.json
- Running the development server
- Using
npm start
to preview the app locally.
- Using
3. JSX (JavaScript XML)
- What is JSX?
- Syntax extension that looks like HTML in JavaScript.
- Why use JSX?
- It helps to write readable UI code and integrates JS logic easily.
- JSX Rules
- One root element
- Self-closing tags
- Use
className
instead ofclass
- Curly braces for JS expressions
4. Components in React
- What are Components?
- Reusable building blocks for UI
- Types of Components:
- Functional Components (modern standard)
- Class Components (older approach)
- Creating Components
- File naming conventions
- Exporting and importing components
- Props in Components
- Passing data from parent to child using props
props.children
concept
5. State Management
- What is State?
- An object that determines the component’s behavior and rendering.
- Using
useState
Hook- Declaring and updating state in functional components.
const [count, setCount] = useState(0);
- Event Handling in React
onClick
,onChange
,onSubmit
- Binding event handlers
6. React Lifecycle (for Class Components)
- Lifecycle Methods:
constructor()
componentDidMount()
componentDidUpdate()
componentWillUnmount()
- useEffect Hook (Functional Lifecycle)
- Side effects like API calls, timers, event listeners
useEffect(() => {
// effect code here
}, []);
7. Conditional Rendering
- Using if-else inside JSX
- Ternary operator
- Logical && operator
{isLoggedIn ? <Dashboard /> : <Login />}
8. Lists and Keys
- Rendering Lists
- Using
.map()
to display arrays
- Using
- Keys in React
- Importance of unique keys for elements in a list
9. Forms and Form Handling
- Handling form inputs
- Controlled components using
useState
- Controlled components using
- Handling submit
- Preventing default and accessing form data
- Form Validation (Basic)
- Using conditionals and error states
10. React Hooks (Modern React)
Hooks let you use state and lifecycle methods in functional components.
- Basic Hooks:
useState
– for local stateuseEffect
– for side effectsuseRef
– for DOM references
- Advanced Hooks:
useContext
– for global stateuseReducer
– for complex state logicuseMemo
,useCallback
– performance optimizationuseLayoutEffect
,useImperativeHandle
11. React Routing (React Router)
- Installing React Router
npm install react-router-dom
- Basic Routing
- Using
<BrowserRouter>
,<Routes>
, and<Route>
- Using
- Route Parameters
- Dynamic routing with
:id
- Dynamic routing with
- Navigation
- Using
Link
,NavLink
, anduseNavigate
- Using
12. State Management with Context API
- What is Context?
- Provides a way to pass data through the component tree without props.
- Creating Context
React.createContext()
- Using Provider and Consumer
- Wrap components in context and access shared data
13. Fetching Data from APIs
- Using fetch() or axios
- Display data using
useEffect
- Loading and Error handling
- Async/Await in useEffect
useEffect(() => {
const fetchData = async () => {
const res = await fetch('https://api.example.com/data');
const data = await res.json();
setData(data);
};
fetchData();
}, []);
14. Styling in React
- CSS Stylesheets
- Inline styles
- CSS Modules
- Styled-components (optional library)
- SASS with React
15. React Developer Tools
- Chrome DevTools Extension for React
- Inspect component tree and props/state
16. Custom Hooks
- Creating your own hook
- Functions that start with
use
- Functions that start with
- Reuse logic across components
function useCounter(initialValue) {
const [count, setCount] = useState(initialValue);
const increment = () => setCount(prev => prev + 1);
return { count, increment };
}
17. Code Splitting and Lazy Loading
- React.lazy and Suspense
- Load components only when needed to improve performance
const LazyComponent = React.lazy(() => import('./LazyComponent'));
18. Testing in React
- Using Jest and React Testing Library
- Unit tests for components
- Snapshot testing
- Mocking functions and events
19. Deployment
- Build the project
npm run build
- Deploy on:
- GitHub Pages
- Vercel
- Netlify
- Firebase Hosting
20. Bonus Topics (Advanced)
- Higher Order Components (HOC)
- Render Props
- Portals
- Error Boundaries
- SSR with Next.js
- React Native (for mobile apps)
Conclusion
Learning React is not just about understanding components—it’s about mastering how to think in a component-driven, declarative style. The above syllabus gives you a clear roadmap from beginner to advanced level. Whether you’re building personal projects or applying for jobs, this structure ensures you cover everything from basics to deployment.