Why?
Sometimes there is a need to read the size of a
window
or a specific HTML element
. The most common reason for that is to display a particular element in an application based on the size of a device.This is a perfect example of logic that will repeat itself in many applications, so it is worth to encapsulate it in a hook.
Usage
Implementation
- 1. Rendering
5 minutes
- 2. Forms
4 minutes
- 3. Events
16 minutes
- 4. Guards
5 minutes