ReactJS Interview questions


Total available count: 9
Subject - JavaScript Frameworks
Subsubject - ReactJS

What is Props in React?

Props are a way to pass information into a React component as properties, they can have any type including functions, sometimes referred to as callbacks. These are read-only and immutable components. This refers to one-directional communication from parent to child components across the application.

Example:-

In JSX props are passed with the attribute syntax

<SlightbookComponent moduleId={1} />

Inside the definition for SlightbookComponent moduleId will now be accessible from the props object.

// The render function inside SlightbookComponent
render() {
 return (
 <span>The module ID is {this.props.moduleId}</span>
 )
}



Next 5 interview question(s)

1
What is a component in React?
2
What are fragments?
3
How to loop inside JSX?
4
What do you understand by Virtual DOM? Explain its working.?
5
What is JSX?