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.


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)

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