Here some React basic parts that beginner should know.

Robiul Islam
2 min readMay 12, 2021

I will be discus about React.js basic. In my concept React.js is a library not a framework. Basically it works with JavaScript. If you know JavaScript basic you can easily handle React.js. React.js have many parts. If you get this parts. You can easily upstand the main concept of React.js. So let’s start discus about of every parts of React.js.

Library not Framework

Vue or Angular are frameworks where decisions are made for you. But React is just a library and you need to make all decisions by yourself. It focuses on helping you to build user interfaces using components.

JSX

JavaScript XML is neither a string nor HTML. It is a syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.

Components

Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation and return HTML via a render() function. Components come in two types, Class components and Function components.

Props

In React data goes down the tree of the components. If you want to pass data from parent to child component you need to use props. From JSX point of view props are HTML attributes.

useState

React components has a built-in state object. The state object is where you store property values that belongs to the component. When the state object changes, the component re-renders.

useEffect

React has a built-in hook called useEffect. Hooks are used in function components. The Class component comparison to useEffect are the methods componentDidMount, componentDidUpdate, and componentWillUnmount.useEffect will run when the component renders, which might be more times than you think.

useContext

Context is designed to share data that can be considered “global” for a tree of React components, such as the current authenticated user, theme, or preferred language.

--

--