Online Exam Quiz

questionQuestion  1 to 30

What is Redux?

  • A library for managing state
  • A CSS framework
  • A React component
  • A testing library
Mark for review

How do you create a React component?

  • By defining a class
  • By defining a function
  • By using HTML tags
  • Both A and B
Mark for review

How do you handle user input in React?

  • Using state
  • Using props
  • Using methods
  • Using events
Mark for review

What is a Higher-Order Component (HOC)?

  • A component that fetches data
  • A component that manages state
  • A function that returns a component
  • A component that handles events
Mark for review

What is the purpose of useMemo hook?

  • To memoize values
  • To handle state
  • To handle events
  • To pass props
Mark for review

What is the use of componentDidMount?

  • To handle events
  • To fetch data after component mounts
  • To initialize state
  • To bind methods
Mark for review

What is the purpose of ReactDOM.render?

  • To update the state
  • To create a component
  • To render a component to the DOM
  • To handle events
Mark for review

What is the use of Fragment in React?

  • To group multiple elements
  • To style components
  • To manage state
  • To handle events
Mark for review

Which of the following is a valid way to handle forms in React?

  • Using controlled components
  • Using uncontrolled components
  • Using HTML forms
  • Both A and B
Mark for review

What is the purpose of componentDidUpdate?

  • To fetch data
  • To handle errors
  • To perform side effects after update
  • To update state
Mark for review

How do you handle errors in a React application?

  • Using error boundaries
  • Using try-catch
  • Using state
  • Using props
Mark for review

What is the use of the key prop in lists?

  • To identify unique elements
  • To reorder elements
  • To add styles to elements
  • To handle events
Mark for review

Which command is used to create a new React application?

  • create-react-app
  • npm init
  • react-init
  • npx create-react-app
Mark for review

Which method is used to handle state in functional components?

  • setState
  • useState
  • componentDidMount
  • render
Mark for review

How do you create a context in React?

  • Using React.createContext
  • Using React.createState
  • Using React.createEvent
  • Using React.createElement
Mark for review

What is the purpose of React?

  • To manage databases
  • To build user interfaces
  • To style web pages
  • To write server-side code
Mark for review

What is the purpose of componentDidCatch?

  • To fetch data
  • To handle errors
  • To optimize performance
  • To update state
Mark for review

Which lifecycle method is called when a component is removed from the DOM?

  • componentDidMount
  • componentWillUnmount
  • componentDidUpdate
  • render
Mark for review

What is the purpose of useRef hook?

  • To create a reference
  • To handle state
  • To manage events
  • To pass props
Mark for review

How do you access state in a class component?

  • this.state
  • this.props
  • this.setState
  • this.useState
Mark for review

How do you handle asynchronous operations in React?

  • Using async/await
  • Using Promises
  • Using callback functions
  • All of the above
Mark for review

How do you style components in React?

  • Using CSS
  • Using inline styles
  • Using styled-components
  • All of the above
Mark for review

Which hook is used for side effects in functional components?

  • useState
  • useEffect
  • useReducer
  • useContext
Mark for review

How do you optimize a React application?

  • Using memoization
  • Using lazy loading
  • Using code splitting
  • All of the above
Mark for review

What is the purpose of prop-types?

  • To handle state
  • To enforce type checking
  • To fetch data
  • To create components
Mark for review

How do you pass data to a child component?

  • Using states
  • Using methods
  • Using props
  • Using functions
Mark for review

How do you create a Higher-Order Component?

  • By wrapping a component with a function
  • By using a class component
  • By using a functional component
  • By using hooks
Mark for review

How do you access a child component's methods in React?

  • Using refs
  • Using state
  • Using props
  • Using context
Mark for review

Which method is used to re-render a class component?

  • render
  • setState
  • forceUpdate
  • updateState
Mark for review

What is the purpose of lazy and Suspense in React?

  • To optimize performance
  • To create a component
  • To handle errors
  • To lazy load components
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review