File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -163,8 +163,7 @@ function useOnyx<TKey extends OnyxKey, TReturnValue = OnyxValue<TKey>>(
163163
164164 useEffect ( ( ) => ( ) => onyxSnapshotCache . deregisterConsumer ( key , cacheKey ) , [ key , cacheKey ] ) ;
165165
166- // Precompute whether this key is a skippable collection member so that getSnapshot()
167- // can use a cheap boolean check instead of calling splitCollectionMemberKey on every render.
166+ // Precompute whether this key is a skippable collection member key.
168167 const isSkippableKey = useMemo ( ( ) => {
169168 const skippableIDs = OnyxUtils . getSkippableCollectionMemberIDs ( ) ;
170169 if ( ! skippableIDs . size ) {
@@ -247,7 +246,6 @@ function useOnyx<TKey extends OnyxKey, TReturnValue = OnyxValue<TKey>>(
247246
248247 const getSnapshot = useCallback ( ( ) => {
249248 // Fast path: if subscribing to a skippable collection member id, return undefined as loaded immediately.
250- // The `isSkippableKey` flag is precomputed so we avoid calling splitCollectionMemberKey here.
251249 if ( isFirstConnectionRef . current && isSkippableKey ) {
252250 if ( resultRef . current [ 1 ] . status !== 'loaded' || resultRef . current [ 0 ] !== undefined ) {
253251 resultRef . current = [ undefined , { status : 'loaded' } ] ;
You can’t perform that action at this time.
0 commit comments