मुख्य कंटेंट तक स्किप करें

Dimensions

useWindowDimensions automatically updates the width and height values when the screen is resized. You can get the width and height of the application window like this:

const windowWidth = useWindowDimensions().widthconst windowHeight = useWindowDimensions().height

Example#

This is usually necessary in order to make the properties dynamic.

Questions#

What is the name of the hook for determining the value of the width and height when the screen is resized?

  1. useDimensions
  2. winDimensions
  3. useWindowDimensions

To see how well you learned this lesson, take the test in the mobile application of our school on this topic or in the telegram bot.

Sumerian school

Links:#

  1. React Native

Contributors ✨#

Thanks goes to these wonderful people (emoji key):


Dmitriy Vasilev

📖💲

Become a Patron!