Skip to main content

Command Palette

Search for a command to run...

Beginner's Guide: Important Fundamentals to Know Before Learning React

Updated
β€’6 min read
Beginner's Guide: Important Fundamentals to Know Before Learning React
S

I’m an Incoming SDE Intern (.NET) focused on improving my skills in C#, JavaScript, and SQL. I share what I learn through simple explanations to help other beginners grow in their coding journey πŸš€.

Before learning React, it's important to build a strong foundation. React is easier to understand when you already know the basics of how webpages work. In this guide, you’ll learn the essential skills you should know first β€” HTML, CSS, and JavaScript β€” and why these basics prepare you to learn React faster, with fewer mistakes and more confidence.

1. HTML Basics (Before Learning React)

Before learning React, it’s important to understand the basics of HTML, because React uses HTML-like syntax called JSX. If you know how HTML works, JSX becomes very easy.

You should know common tags like:

  • <div> β€” container for grouping content

  • <h1> to <h6> β€” headings

  • <p> β€” paragraph

  • <img> β€” images

  • <span> β€” inline text

These tags help you understand the structure of a UI, which React components will return later.

πŸ‘‰ Forms

You should also know how basic HTML forms work:

  • <input> β€” text fields

  • <button> β€” for clicks

  • <form> β€” handles user input

In React, you will control inputs using state, but the base idea comes from HTML.

πŸ‘‰ Basic Page Structure

You don’t need to know everything, just the essentials:

  • <html>

  • <head>

  • <body>

React replaces many parts of manual DOM handling, but it still renders inside an HTML page (usually a <div id="root">).

βœ” Why HTML is important before React?

React returns JSX, which looks like this:

function App() {
  return <h1>Hello React</h1>;
}

This looks similar to HTMLβ€”so if you understand tags, form elements, and page structure, learning React becomes much easier.

βœ… If you're new to HTML, you can learn the basics from here:

If you're new to HTML, you can learn the basics from here:

These sites give simple examples and interactive practice, which helps you understand HTML quickly.

2. CSS Basics (Before Learning React)

CSS (Cascading Style Sheets) is what makes a webpage look beautiful.
Before React, you don’t need to master advanced CSS, but you must understand the fundamentals, because React components also need styling.

πŸ‘‰ Selectors

CSS uses selectors to target HTML elements.

h1 { color: blue; }
p { font-size: 16px; }

You should know:

  • Element selectors (div, p)

  • Class selectors (.container)

  • ID selectors (#header)

In React, we mostly use className instead of class:

<div className="card">Hello</div>

πŸ‘‰ Styling Layouts (Flexbox is most important)

Learn the basic of layout:

Flexbox (must learn)

Used to align items horizontally or vertically.

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

React UI libraries and Tailwind also use flexbox concepts, so knowing this is very helpful.

πŸ‘‰ Spacing (Padding & Margin)

These two are everywhere in UI:

  • Margin β†’ space outside the element

  • Padding β†’ space inside the element

.box {
  margin: 20px;
  padding: 10px;
}

In React, you will style components using the same concept.

πŸ‘‰ Colors, Borders & Backgrounds

Basics you should know:

.card {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
}

This helps you style React components like cards, buttons, and layouts.

πŸ‘‰ Typography (Text Styling)

Learn:

  • font-size

  • font-weight

  • text-align

Example:

h1 {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
}

πŸ‘‰ Responsive Basics

Not required in the beginning, but good to know:

  • max-width

  • width: 100%

  • @media queries

React apps should look good on all screen sizes, so this knowledge becomes helpful.


βœ” Why CSS is important before React?

Even though React handles UI with components, styling is still CSS.
Knowing CSS helps you:

  • Design components

  • Create layouts

  • Understand Tailwind (if you use it later)

  • Work with modern UI libraries

Without CSS basics, your React apps will not look good.

These sites give simple examples and interactive practice, which helps you understand CSS quickly.

3. JavaScript Basics (Before Learning React)

JavaScript is the most important skill you need before learning React.
React is built using JavaScript, and almost everything in Reactβ€”components, props, state, hooksβ€”is just JavaScript with JSX.

You don’t need to master advanced JavaScript right now, but you must understand the core fundamentals.


πŸ‘‰ Variables (let & const)

In modern JavaScript, we use:

  • let β†’ value can change

  • const β†’ value cannot change

Example:

let count = 0;
const name = "React";

React uses const a lot when creating components:

const App = () => {
  return <h1>Hello</h1>;
};

πŸ‘‰ Functions

Functions are very important because React components are functions.

Example:

function greet() {
  return "Hello JavaScript";
}

Arrow function (used in React):

const greet = () => "Hello React";

React component:

const App = () => <h1>Hello</h1>;

πŸ‘‰ Arrays & Objects

You must understand how to work with arrays and objects, because you will use them in React for:

  • Lists

  • API data

  • State updates

Example Object:

const user = { name: "Sandip", age: 22 };

Example Array:

const items = ["React", "JavaScript", "CSS"];

React list rendering uses arrays:

items.map(item => <li>{item}</li>);

πŸ‘‰ Array Methods (especially map)

.map() is used in React to display lists.

Example:

const numbers = [1, 2, 3];
numbers.map(n => n * 2); // [2, 4, 6]

In React:

numbers.map(n => <p>{n}</p>);

πŸ‘‰ If/Else & Ternary Operator

Conditional rendering in React uses these a lot.

Ternary example:

const loggedIn = true;
loggedIn ? "Welcome" : "Login Please";

React example:

{loggedIn ? <Home /> : <Login />}

πŸ‘‰ ES6 Concepts (Must Know)

βœ” Destructuring

const user = { name: "Sandip" };
const { name } = user;

βœ” Spread operator

const arr2 = [...arr1, 4, 5];

βœ” Import / Export

Used in React for components:

import App from "./App";
export default App;

πŸ‘‰ Understanding the DOM (basic only)

You don’t need deep DOM knowledge, but you must know:

  • What is DOM

  • document.getElementById

  • How HTML updates

React manages the DOM for you, but the concept helps beginners.


βœ” Why JavaScript is important before React?

Because React uses JavaScript everywhere:

  • Components β†’ functions

  • State β†’ variables

  • Props β†’ objects

  • Lists β†’ arrays + map

  • Events β†’ arrow functions

The stronger your JavaScript basics, the faster you understand React.


These sites give simple examples and interactive practice, which helps you understand JavaScript quickly.

πŸ“Œ What You Learned

In this beginner guide, you learned:

  • Why HTML, CSS, and JavaScript are important before React

  • The basic concepts you must know from each

  • How these fundamentals make your React journey easier

➑️ Coming Next

In the next part of this React Learning Series, we’ll start with:
β€œUnderstanding the DOM (in simple terms)”

Originally published on Medium.

More from this blog

React with Sandip

7 posts

React with Sandip is a beginner-friendly publication where I share React concepts in simple language, helping new developers learn from basics to advanced with examples and step-by-step guides.