File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1+ Fix flashing wrong layout on init
Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ import { IonicNativePlatformProvider } from './components/Ionic/components/Ionic
2727export function App ( ) {
2828 useRouteRedirects ( )
2929 const { i18n } = useTranslation ( )
30+ const [ isResponsiveContextInitialized , setIsResponsiveContextInitialized ] = React . useState ( false )
3031 const isMobile = useContext ( ResponsiveContext ) === 'small'
3132
33+ React . useEffect ( ( ) => {
34+ // TODO: remove this if grommet fixes and runs this on useLayoutEffect
35+ // https://github.com/grommet/grommet/blob/9d3a8e4/src/js/components/Grommet/Grommet.js#L109-L111
36+ setIsResponsiveContextInitialized ( true )
37+ } , [ ] )
38+
39+ if ( ! isResponsiveContextInitialized ) return null
3240 return (
3341 < FatalErrorHandler >
3442 < IonicNativePlatformProvider >
You can’t perform that action at this time.
0 commit comments