Move mobile tasks client ref sync out of effect (#3253)
* Move mobile tasks client ref sync out of effect * Use layout effect for mobile tasks client ref Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com> Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
56f761d93d
commit
2e185a7c4f
|
|
@ -1,4 +1,4 @@
|
|||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
import {
|
||||
ActivityIndicator,
|
||||
|
|
@ -2534,7 +2534,9 @@ export default function MobileTasksScreen() {
|
|||
return [...logins].sort().join(',')
|
||||
}, [projectRowDetail, projectRowItem?.content.assignees])
|
||||
|
||||
useEffect(() => {
|
||||
// Why: task-loading effects use this as a stale-client guard, so the ref
|
||||
// must be current before those passive effects can run after commit.
|
||||
useLayoutEffect(() => {
|
||||
clientRef.current = client
|
||||
}, [client])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue