WorksheetsReactJS Quiz
Total questions: 15
Worksheet time: 5mins
What is the best definition of React.js?
Server-side Framework
User-interface framework
A Library for building interaction interfaces
None of These
What is the purpose of using JSX in React?
To style components
To make API calls
To describe what the UI should look like
To manage state
In React.js, how we can pass the data from one component to another in React.js?
SetState
Render with arguments
Props
PropTypes
How does data flow naturally in React apps?
From parents to children
From children to parents
Both ways
The developers decides.
Which of the following is true about key props?
"Key" props are used to look beauty
"Key" prop is a way to identify the newly added element
It is one type of attribute of HTML
It is not used in the array
An effect will always run on the initial render.
True
It depends on the dependency array
False
In depends on the code in the effect
What triggers a UI re-render in React?
Running an effect
Passing props
Updating state
Adding event listeners to DOM elements
What's the fundamental building block of React apps?
Components
Blocks
Elements
Effects
What is the most likely preferred port number on which the application runs?
3000
8080
5000
3030
Which of the following is a way to handle data in React.js?
State & Props
Services & Components
State & Services
State & Component
Which variables should go into the useEffect dependency array?
Usually none
Function
All state and props referenced in the effect
All variables needed for clean up
Which of the following is must for the API in React.js?
SetinitialComponent
renderComponent
render
All of the above
Which hook to use for an API request on the component's initial render?
useState
useEffect
useRef
useReducer
Which of the following commands 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
Which of the following is NOT a feature of React?
Virtual DOM
Two-way data binding
Component-based architecture
Unidirectional data flow
