Question Bank · Section 02
State & Props
9 questions. How React components receive data through props, own data through state, update it immutably and validate inputs.
State and props are the two inputs that decide what every component renders, so interviewers use them to check your mental model of React. Expect questions on how they differ, how state updates work, why immutability matters and how to validate props with PropTypes or TypeScript.
01State & Props02Difference between State and Props03What is setState in React?04Why is state immutable in React?05Which function is used for updating the state of a component?06What is the advantage of choosing props over states?07Give an example of a stateless component08What is Props Validation?09What are the different data types available in React.PropTypes?