mvasin / react-div-100vh

A workaround for the '100vh' issue in mobile browsers

Home Page:https://react-div-100vh.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This doesn't work with gatsby?

mhedengren opened this issue · comments

Somehow I cannot get this to work with gatsby, the safari toolbar in iOS is still covering the div. I'm using the FullHeightComponent on my index page within the Layout compontent.

repo: https://github.com/mhedengren/just-a-test

netlify for checkout on phone https://objective-kowalevski-bd15a4.netlify.app/

Am I doing something wrong?

Hi Melker,

thanks for reporting and for the nice reproduction. Will look into it tomorrow.

I spotted a problem with SSR and tried to so solve it - my attempt is already on master and published as react-div-100vh@0.5.1-beta.2. It seems to work in iOS Chrome, but seems not to work in iOS Safari (I'm on iOS version 13.6.1).

The idea came from https://joshwcomeau.com/react/the-perils-of-rehydration/, but I suspect that some non-gatsby but SSRed apps may re-render unpredictable amount of times before getting flushing SSRed HTML to the client, so the proposed solution to render in two passes may not suit all.

@mhedengren I'm still exploring this issue and will keep you updated.

I spotted a problem with SSR and tried to so solve it - my attempt is already on master and published as react-div-100vh@0.5.1-beta.2. It seems to work in iOS Chrome, but seems not to work in iOS Safari (I'm on iOS version 13.6.1).

The idea came from https://joshwcomeau.com/react/the-perils-of-rehydration/, but I suspect that some non-gatsby but SSRed apps may re-render unpredictable amount of times before getting flushing SSRed HTML to the client, so the proposed solution to render in two passes may not suit all.

@mhedengren I'm still exploring this issue and will keep you updated.

Ok I see! Sounds great :) Many thanks for taking your time do to this.

Hi @mhedengren! If you're still using the component, can you try out react-div-100vh@0.7.0-beta.1? The API might have changed, please consult the readme.