Element – An element is an object describing what you would like to project on the screen in terms of the DOM nodes or other components. Elements can contain other elements in their props. Once a component is created , it’s never mutated.
Example –
<button class=â€greenâ€> </button>
Component – A component is a function or class that accepts an input and returns a React element. It has to keep references to its DOM nodes and to the instances of the child components.
Example –
const LogIn = () => (
<div>
<p> Login </p>
<button> Continue </button>
<button color = “blueâ€> Cancel </button>
</div>
);
Posted Date:- 2021-09-23 14:37:47
When to use a Class Component over a Function Component?
What are controlled and uncontrolled components in React?
What is render() in React? And explain its purpose?
How to declare a variable in React jS?
How to create an event in React?
How to check the React jS version?
How to import jS files in react?
How to install bootstrap in React JS?
How to create a website in React JS?
How to connect MongoDB with React JS?
Explain the different phases of the ReactJS component lifecycle?
How Virtual-DOM is more efficient than Dirty checking?
What is a higher-order component in React?
Why can’t browsers read JSX?
What do you understand from "In React, everything is a component."
What are Pure Components in React?
What is the difference between element and component?
What is the purpose of render() in React?
What are Higher Order Components (HOC)?
Explain the new lifecycle methods in React 16.3?
What is the significance of Keys in React?
Explain the lifecycle methods of ReactJS?
What are controlled components?
What are the differences between a class component and functional component?
What is ReactDOM and what is the difference between ReactDOM and React?
What are the limitations of React?
List some of the major advantages of React.
What are the features of React?
Can web browsers read JSX directly?
What are the advantages of React?