about summary refs log tree commit diff
path: root/src/Splash.android.tsx
blob: a12b52b8bb50c95055c634467cd6b12d36ffe70c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {useEffect} from 'react'
import * as SplashScreen from 'expo-splash-screen'

type Props = {
  isReady: boolean
}

export function Splash({isReady, children}: React.PropsWithChildren<Props>) {
  useEffect(() => {
    if (isReady) {
      SplashScreen.hideAsync()
    }
  }, [isReady])
  if (isReady) {
    return children
  }
}