Код: Выделить всё
const useBodyMinHeight = (location: 'home' | 'loading' | 'application') => {
const viewportHeight = `${window.innerHeight}px`;
const setBodyMinHeight = (location: 'home' | 'loading' | 'application') => {
// document.body.style.backgroundColor = '#E4D00A'; // {
if (isStandaloneMode()) {
setBodyMinHeight(location);
window.addEventListener('focus', () => setBodyMinHeight(location));
window.addEventListener('resize', () => setBodyMinHeight(location));
const { orientation } = window.screen;
if (orientation) {
orientation.addEventListener('change', () => setBodyMinHeight(location));
}
}
}, [location]);
};
export default useBodyMinHeight;
Подробнее здесь: https://stackoverflow.com/questions/790 ... al-browser