Some basic topics of react

Naymul Hasan
2 min readNov 4, 2020

What is react?

According to react js website react is a javascript library to make user interface.React actually use diffing algorithm.

What is react component?

React component is the building block of a react app.You can make a react app using so many react component.They serve the same purpose as JavaScript functions, but work in isolation and returns HTML via a render function. Components come in two types, Class components and Function components.Then one question will come to your mind that how does react component actually look like.Let’s see the below image

In the above picture this is a class components of react..The car component return an <h2> tag.

Pure components:

If a react component does not depend on anything outside of its definition(if does not use a global ,variable)we can label it as a pure component

What is JSX?

JSX means javascript Xml.It allows us to write html code into react.Jsx makes it easier to write html in reat.We can also write expression in jsx but we can not use any if statement in jsx.To use expression in jsx we must need to use curly braces {}.Transfiler convert jsx into javascript.

What is the props?

You can use the attribute in react element like html attribute.All the attribute we use with react element will pass to the compnent as object and we will get the object in props.

What is the state?

The state object is where you can store property valus belong to the component.Whe the state object changes the component will re render.

What is hook?

Hooks are new features in react.It allows you to use react state without creating class.Basically hooks are function too.They return 2 things one is a variable and the other is a setter function.

--

--

Naymul Hasan

I am Naymul Hasan Fahim a javascript enthusiast.I love to write code.My core skill is based on javascript