[Statsig] Make gate checks lazily (#3594)

This commit is contained in:
dan 2024-04-18 04:39:29 +01:00 committed by GitHub
parent 086dc93a7a
commit 02becdf449
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 67 additions and 62 deletions

View file

@ -143,7 +143,7 @@ function ProfileScreenLoaded({
const setMinimalShellMode = useSetMinimalShellMode()
const {openComposer} = useComposerControls()
const {screen, track} = useAnalytics()
const shouldUseScrollableHeader = useGate('new_profile_scroll_component')
const gate = useGate()
const {
data: labelerInfo,
error: labelerError,
@ -317,7 +317,7 @@ function ProfileScreenLoaded({
// =
const renderHeader = React.useCallback(() => {
if (shouldUseScrollableHeader) {
if (gate('new_profile_scroll_component')) {
return (
<ExpoScrollForwarderView scrollViewTag={scrollViewTag}>
<ProfileHeader
@ -343,7 +343,7 @@ function ProfileScreenLoaded({
)
}
}, [
shouldUseScrollableHeader,
gate,
scrollViewTag,
profile,
labelerInfo,