The Basics of React
Hello Readers! So, let’s get started! In this article, we will tie together a lot of the concepts and techniques you’ve learned in React.
React Limitations
React is just a library, not a full-blown framework.
Its library is vast and takes time to understand
It can be a little difficult for novice programmers to understand
Coding gets complex as it uses inline templating and JSX
Virtual DOM Vs. Real DOM
Using Virtual DOM:
- You can directly update the HTML.
- It acts as a copy of the real DOM, which can be manipulated and frequently updated without refreshing.
- It can be synced with the real DOM with ‘react-dom.
Using Real DOM:
- It directly updates the HTML.
- It creates a new DOM if it is updated.
JSX
- JSX is the short form of JavaScript XML.
- Using JSX, we can write JavaScript with HTML-like template syntax.
React Props
- Props are arguments passed into React components. Props are passed to components via HTML attributes.
- Props can be passed from parent to child.
- Props cannot be manipulated, which are only meant for read-only.
React State
- State is simply the data component maintains
- If you want to keep the state, you need a class-based component using constructor and super.
- Using Hooks, it’s possible to make a functional component stateful.
We don’t make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.
React can also render on the server using Node and power mobile apps using React Native.
You can also build your website without having to write a single line of code using — https://quickwork.co/
Learn more about our blog on — https://blog.quickwork.co/