The display mode may be based on the viewport dimensions
and if the device is mobile. Also note that you can use isMobile
without the display mode framework.
The display modes are strings that should be passed as a type parameter
to initDisplayMode. You can create an alias in your code for
getting the typed version of addDisplayModeSubscriber, getDisplayMode,
and useDisplayMode from pure-react.
Initialize display mode detection for the app.
The display mode may be based on the viewport dimensions and if the device is mobile. Also note that you can use isMobile without the display mode framework.
The display modes are strings that should be passed as a type parameter to initDisplayMode. You can create an alias in your code for getting the typed version of addDisplayModeSubscriber, getDisplayMode, and useDisplayMode from
pure-react
.Note that this is not necessary in some simple use cases. For example, adjusting styles based on the viewport width can be done with CSS:
Use this only if the display mode needs to be detected programmatically.