Key takeaways
- A React app is a tree of function components; each name starts with a capital letter.
- Props come from the parent and are read-only; state belongs to the component and changes only through its setter.
- Never change state directly: copy arrays and objects with spread, and use
setCount(c => c + 1)when the new value depends on the old one. - The dependency list decides when
useEffectruns; forgetting[]in a fetch effect causes an endless loop. - The notes end with a full Todo app in one component and a table of the most common React mistakes.
About these React JS notes
This page offers Uncodemy's React JS notes as a free PDF. React is a JavaScript library for building user interfaces from small, reusable pieces called components. When data changes, React updates only that part of the screen, so you do not touch the DOM yourself. The notes use modern function components and hooks only, explain each idea with a simple picture (such as LEGO blocks or a product card template), and give a short code example for every topic.
Please note: these are original Uncodemy learning notes, not the official React documentation. React changes between versions, so check react.dev for the latest APIs.
What's inside the React JS notes
The PDF has 7 pages arranged in 10 numbered sections. Here is what each section covers.
1. Start with React
What React is, components as LEGO blocks, creating a project with npm create vite@latest, running it with npm run dev, and a table of the project files: index.html, src/main.jsx, src/App.jsx, the components folder and package.json.
2. Components
Writing a component as a function that returns UI, using it like a tag, export default and import, nesting components, reusing one component twice, and why function components are used instead of class components.
3. JSX
A table of HTML versus JSX differences (className, htmlFor, camelCase events, closing every tag and the style object), curly braces for JavaScript values, one parent element or a fragment, conditional rendering with the ternary operator and &&, and lists with map and a unique key.
4. Props
Passing data from parent to child, a product card that shows different products with the same component, props as read-only values, the special children prop, and sending a function as a prop so the child can talk back to the parent.
5. State and useState
State as the memory of a component, the useState syntax, a counter example, a props versus state table, copying arrays with spread, the updater function form, and why the new value appears only in the next render.
6. Events and forms
onClick, onChange and onSubmit, passing the function name instead of calling it, controlled inputs that read from state, and e.preventDefault() on form submit.
7. useEffect hook
The two rules of hooks, when to use useEffect, the cleanup function, a table that explains an empty dependency list, a list with a value and no list at all, and fetching users from an API once.
8. More useful hooks
A table of useRef, useContext, useReducer, useMemo and useCallback with a simple meaning and a use for each, focusing an input with useRef, useContext in three steps, and writing a custom useCounter hook.
9. Projects to build
Six projects (counter, Todo list, weather app, quiz app, shopping cart and notes app) with the skills each one practises, then a step-by-step Todo list mini project and its complete code in one component.
10. Common mistakes and practice
A mistakes and fixes table (pushing into state, missing keys, onClick={handle()}, a fetch effect without [], hooks inside if and small-letter component names) and 8 practice questions.
How to use these notes to learn React
React is easiest to learn by building. Create one Vite project and keep adding to it as you read.
- Type each example into a new component file instead of copying it, and watch the browser update.
- Install React Developer Tools in your browser to see props and state of each component.
- After the state section, build the counter; after useEffect, build the weather or users list.
- Push each project to GitHub with a README and a screenshot.
A simple three-pass method works well. In the first pass, read one section and type its examples. In the second pass, close the notes and rebuild the example with a small change, such as a counter that cannot go below zero. In the third pass, a day or two later, answer the practice questions aloud and add one feature to the Todo app from section 9.
Syntax to remember
const [value, setValue] = useState(initialValue);setTodos([...todos, newTodo])to add to an array in state, andtodos.filter(t => t.id !== id)to remove.useEffect(() => { ... ; return () => { /* cleanup */ }; }, [dependencies]);{items.map(item => <li key={item.id}>{item.name}</li>)}with a stable key.{isLoggedIn ? <p>Welcome back</p> : <p>Please login</p>}for conditional rendering.onClick={handle}, notonClick={handle()}.
Common mistakes beginners make
- Changing state directly with
pushorcount = 5instead of the setter. - Leaving out the
keyin a list, or using the index when the list can reorder. - Calling the function in
onClickso it runs on every render. - Forgetting the dependency list in a fetch effect, which makes an endless loop.
- Calling hooks inside
ifblocks or loops, or naming a component in small letters.
Interview focus: React topics asked most
React questions in front-end and full stack fresher interviews usually start with the basics covered here before moving to routing and performance.
- Components and why they are reused.
- Props versus state.
- JSX and how it differs from HTML.
useStateand why state is not changed directly.useEffectand its dependency list,useRef,useContextand custom hooks.
Typical questions
- What is a component? Why do we reuse components?
- What is the difference between props and state?
- What is JSX? Name three differences from HTML.
- What does useState return? Why not change state directly?
- Explain useEffect and its dependency list with examples.
- When do you use useRef and useContext?
- What is a custom hook? Write one.
- Build a Todo app with add and delete.
For deeper questions on rendering, performance, routing and testing, use the React Interview Questions PDF after these notes.
A 7-day plan for React
- Day 1: Start with React, components. Create a Vite project and split a page into Navbar, Home and Footer.
- Day 2: JSX, props. Build a product list that reuses one card component.
- Day 3: State and useState, events and forms. Build the counter and a controlled form.
- Day 4: useEffect. Fetch a list of users from a public test API and show loading and error states.
- Day 5: More useful hooks. Add a theme switch with useContext and write a custom hook.
- Day 6: Projects to build. Type the Todo app from the notes, then add edit and localStorage.
- Day 7: answer the 8 practice questions from memory, fix your code against the common mistakes table and deploy one project on Vercel or Netlify.
Revise one section a day after that and build one small project every week.
Who these notes are for
- Students who know HTML, CSS and basic JavaScript and want to learn React.
- B.Tech, BCA and MCA students building a front-end or final year project.
- Learners in a MERN or full stack course who want a short hooks reference.
- Freshers revising React basics before front-end or full stack interviews.
React needs JavaScript first: if arrays, arrow functions, destructuring and promises are new to you, read the JavaScript Notes PDF before these notes.
Download React JS Notes PDF
React JS Notes PDF: Hooks, Components, Projects
The PDF carries the same content as this page in a clean, print-ready layout, so you can read it offline and keep it for revision.
7 pages · 126 KB · PDF · Updated 5 Nov 2026