diff options
author | Hailey <me@haileyok.com> | 2024-11-09 16:24:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-09 16:24:51 -0800 |
commit | 89c93313a3fc3123a2e53856f53cc8cea8e693fa (patch) | |
tree | f0189bdd75fcdb151ed74f8b43057ddee631b907 /src/alf | |
parent | 3aeee1e4aa9ae76d2c3638ab2fad54d7171effbf (diff) | |
download | voidsky-89c93313a3fc3123a2e53856f53cc8cea8e693fa.tar.zst |
android scroll performance fixes pt. 1 (#6196)
Diffstat (limited to 'src/alf')
-rw-r--r-- | src/alf/index.tsx | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/src/alf/index.tsx b/src/alf/index.tsx index f9d93d4ca..5d08722ff 100644 --- a/src/alf/index.tsx +++ b/src/alf/index.tsx @@ -103,35 +103,32 @@ export function ThemeProvider({ }) }, []) - return ( - <Context.Provider - value={React.useMemo<Alf>( - () => ({ - themes, - themeName: themeName, - theme: themes[themeName], - fonts: { - scale: fontScale, - scaleMultiplier: fontScaleMultiplier, - family: fontFamily, - setFontScale: setFontScaleAndPersist, - setFontFamily: setFontFamilyAndPersist, - }, - flags: {}, - }), - [ - themeName, - themes, - fontScale, - setFontScaleAndPersist, - fontFamily, - setFontFamilyAndPersist, - fontScaleMultiplier, - ], - )}> - {children} - </Context.Provider> + const value = React.useMemo<Alf>( + () => ({ + themes, + themeName: themeName, + theme: themes[themeName], + fonts: { + scale: fontScale, + scaleMultiplier: fontScaleMultiplier, + family: fontFamily, + setFontScale: setFontScaleAndPersist, + setFontFamily: setFontFamilyAndPersist, + }, + flags: {}, + }), + [ + themeName, + themes, + fontScale, + setFontScaleAndPersist, + fontFamily, + setFontFamilyAndPersist, + fontScaleMultiplier, + ], ) + + return <Context.Provider value={value}>{children}</Context.Provider> } export function useAlf() { |