React.js Quiz | Set-1
Which of the following command is used to create react-js-app ?
npx create-react-app appname
npm install create-react-app
npx install create-react-app -g
install - l create-react-app
Question 1 Explanation:
The correct syntax for installing react app is npx create-react-app app name where app name is the name of the app you want to create.
In React.js which one of the following is used to create a class for Inheritance ?
Question 2 Explanation:
The meaning of Extends in react.js is to create a class for the Inheritance So the correct answer is Extend.
What is the default port number in which the application run ?
Question 3 Explanation:
The default port number in which react application runs are 3000.
Which of the following valid component return type of React ?
Question 4 Explanation:
The only valid component return type of React. The return type in React is by render() function.
Which of the following is a way to handle data in React.js ?
State & Props
Services & Components
State & Services
State & Component
Question 5 Explanation:
State and Props are ways to handle data in React.js where the state is mutable and props are unchangeable.
Which of the following is must for the API in React.js ?
All of the above
Question 6 Explanation:
The renderComponent is not a function that is used as API for the React.js.
Which of the following is true regarding Babel ?
Both of the above
None of the above
Question 7 Explanation:
Babel is both compiler and Transpiler which is used to run the react.js application.
In React.js, how we can pass the data from one component to another in React.js ?
Render with arguments
Question 8 Explanation:
Props can help to pass the data from one component from another in react.js. Props are un-mutable so that they cant be changed.
Which of the following function is true about changing the state in React.js ?
All of the above
Question 9 Explanation:
The this.setState is used for changing the state in React.js whenever the state changes in react then it re-render the component in the browser.
Which of the following method is true about referring parent class in React.js ?
Question 10 Explanation:
The super() is a method in which referring the parent class in react.js. It is the way for calling the constructor in React.js.
There are 15 questions to complete.
My Personal Notes arrow_drop_up