Question · JavaScript and React course · Module 14: Advanced Styling

The useMediaQuery Hook in React

What is the purpose of the custom useMediaQuery hook in React?

Answer options

  • To listen for window resize changes and return true/false based on a media query
  • To load different CSS stylesheets depending on the browser
  • To automatically generate responsive CSS classes
  • To change the user's screen resolution

You can check the correct answer by solving this task in the CodeWorlds game.