Some Fundamentals of React!

Nihal Towfiq
4 min readNov 4, 2020
Some Fundamental of ReactJS.

You are looking for a blog to know about React. Right? If you want to know the fundamental of React and touch on the basic concept. The article is for you. Here I have discussed some concepts about React that will you bring React skill and knowledge to the next level.

What is React?

React (also known as React.js or ReactJS) is an open-source, front end, JavaScript library for building user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies. React can be used as a base in the development of single-page or mobile applications. However, React is only concerned with rendering data to the DOM, and so creating React applications usually requires the use of additional libraries for state management and routing. Redux and React Router are respective examples of such libraries.

1. Framework or library

Library is a small thing where you can take your own decision. On the other hand, the framework is a big thing where you do your work according to the framework. React is a library. You can make things from your comfort zone using the library. But in the framework, you’ll have to break your comfort zone to make anything. The Framework is hard for beginners whereas the library is beginner-friendly.

2. JSX

JSX mean JavaScript Syntax Extension. This is used to create UI. All are people who don’t write fancy markup code as function calls. For that, they come up with JSX a syntax sugar at Facebook. It going with the full power of JavaScript rendering. JSX is very simple to understand. It’s often become very irritating to write the same thing again and again. So, Facebook came up with JSX. Using JSX you can avoid much repetitive code.

3. Component

Components are the heart of React. The component is another important part of React which use to make reasonable UI. Here, have made a combination with HTML + JavaScript with CSS. Have two types of components.
1. Functional Component 2. Class Component

5. React PropTypes

Before talking about the props, you should know there are different types of props. Props are also the most important thing in React. With props to pass data to child component from parent. It can also use its data in the component. Such as …
Component.propTypes = {
optionalArray: PropTypes.array,
optionalBool: PropTypes.bool,
optionalFunc: PropTypes.func,
optionalNumber: PropTypes.number,
optionalObject: PropTypes.object,
optionalString: PropTypes.string,
optionalSymbol: PropTypes.symbol,
}

5. State

The best part about react is you can use State to avoid much repetitive code. It’ll help you to change the condition of a situation. The state declared to update components representation n memory with rendering method. Many times we change our value such as calculating and buying price, in that case, use the state to update in React Component our value.

6. React Router

React Router is a tool that allows you to handle routes in a web app, using dynamic routing. Components are the heart of React’s powerful, declarative programming model. React Router is a collection of navigational components that compose declaratively with your application. Whether you want to have bookmarkable URLs for your web app, React Router works wherever React is rendering.

7. React Context API

Context provides a way to pass data through the component tree without having to pass props down manually at every level. For a more in-depth definition, it provides a way for you to make particular data available to all components throughout the component tree no matter how deeply nested that component maybe. React Context uses components as a global state. This allows us to share data to all in components without props pass.

8. Redux

Redux is a predictable state container for JavaScript apps. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time-traveling debugger. Redux is the most powerful Flux implementation. It has lots of features and a functional, testable approach with clean. It builds up more interaction and fancies the site in React.

9. React Dev Tools

React offers also react dev tool to test and build any site properly. It can be used with Chome, Firefox, and Chromium Edge. It helps the developer to the significant performance gain.

10. Up to Date

React always follow up to date following finding the easiest way to build function. For Example, React 16.3, it works lifecycle methods, in react 16.6 we see async components and now in 16.7, we get hooks that use the alternative of class components.

Conclusion:

Thank you so much for reading the article. I hope you have enjoyed and known a lot about React. It was just for a beginner and I will also more write about react and javascript. If have any questions you can let me know. Feel free to share with others.

--

--