MCPcopy
hub / github.com/zoontek/react-native-bootsplash / useHideAnimation

Function useHideAnimation

src/index.ts:87–280  ·  view source on GitHub ↗
(config: UseHideAnimationConfig)

Source from the content-addressed store, hash-verified

85}
86
87export function useHideAnimation(config: UseHideAnimationConfig) {
88 const {
89 manifest,
90 ready = true,
91
92 logo: logoSrc,
93 darkLogo: darkLogoSrc,
94 brand: brandSrc,
95 darkBrand: darkBrandSrc,
96
97 animate,
98
99 statusBarTranslucent,
100 navigationBarTranslucent,
101 } = config;
102
103 // __DEV__ global is missing in react-native-web
104 if (typeof __DEV__ !== "undefined" && __DEV__) {
105 controlEdgeToEdgeValues({ statusBarTranslucent, navigationBarTranslucent });
106 }
107
108 const skipLogo = logoSrc == null;
109 const skipBrand = manifest.brand == null || brandSrc == null;
110
111 const logoWidth = manifest.logo.width;
112 const logoHeight = manifest.logo.height;
113 const brandBottom = manifest.brand?.bottom;
114 const brandWidth = manifest.brand?.width;
115 const brandHeight = manifest.brand?.height;
116
117 const [
118 {
119 darkModeEnabled,
120 logoSizeRatio = 1,
121 navigationBarHeight = 0,
122 statusBarHeight = 0,
123 },
124 ] = useState(() => NativeModule.getConstants());
125
126 const backgroundColor: string =
127 darkModeEnabled && manifest.darkBackground != null
128 ? manifest.darkBackground
129 : manifest.background;
130
131 const logoFinalSrc: ImageRequireSource | undefined = skipLogo
132 ? undefined
133 : darkModeEnabled && darkLogoSrc != null
134 ? darkLogoSrc
135 : logoSrc;
136
137 const brandFinalSrc: ImageRequireSource | undefined = skipBrand
138 ? undefined
139 : darkModeEnabled && darkBrandSrc != null
140 ? darkBrandSrc
141 : brandSrc;
142
143 const ref = useRef({
144 layoutReady: false,

Callers

nothing calls this directly

Calls 2

hideFunction · 0.85
getConstantsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…