Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix very very common rerender on RN introduced by 1.121.0

authored by

uwx and committed by
Tangled
c2f69e7b 9592ad47

+17 -13
+5 -4
src/lib/hotkeys/index.native.tsx
··· 1 + import {useMemo} from 'react' 2 + 1 3 export function Provider({children}: {children: React.ReactNode}) { 2 4 return children 3 5 } 4 6 7 + const noopScope = () => {} 8 + 5 9 export function useHotkeysContext() { 6 - return { 7 - enableScope: () => {}, 8 - disableScope: () => {}, 9 - } 10 + return useMemo(() => ({enableScope: noopScope, disableScope: noopScope}), []) 10 11 }
+12 -9
src/state/shell/drawer-open.tsx
··· 1 - import {createContext, useContext, useState} from 'react' 1 + import {createContext, useCallback, useContext, useState} from 'react' 2 2 3 3 import {useHotkeysContext} from '#/lib/hotkeys' 4 4 ··· 14 14 const [state, setState] = useState(false) 15 15 const {disableScope, enableScope} = useHotkeysContext() 16 16 17 - const setDrawerOpen = (open: boolean) => { 18 - if (open) { 19 - disableScope('global') 20 - } else { 21 - enableScope('global') 22 - } 23 - setState(open) 24 - } 17 + const setDrawerOpen = useCallback( 18 + (open: boolean) => { 19 + if (open) { 20 + disableScope('global') 21 + } else { 22 + enableScope('global') 23 + } 24 + setState(open) 25 + }, 26 + [disableScope, enableScope], 27 + ) 25 28 26 29 return ( 27 30 <stateContext.Provider value={state}>