chore(deps): upgrade react to 19.2.7 and react types to 19.x (#1154)

Bump react and react-dom 19.1.2 -> 19.2.7 and @types/react and
@types/react-dom from v18 to v19. Keeps babel-plugin-react-compiler,
which is a separate build-time tool, not part of the React 19 runtime.

The @types v19 upgrade surfaced 21 type-only errors, all fixed without
runtime behavior changes:

- useRef<T>() now requires an explicit argument: pass undefined
- DOM element refs are RefObject<T | null>: widen PostFormFields and
  AdvancedSettings ref prop types accordingly
- retype reply-modal onInput handler to FormEvent + currentTarget
- add a null guard for the boards-bar search input
- update test mocks for stricter cloneElement/forwardRef typings

Verified: type-check, lint, 1051 tests, and build pass; react-doctor
score unchanged at 54; browser smoke across Chromium/Firefox/WebKit
plus mobile viewport clean.
This commit is contained in:
Tommaso Casaburi
2026-06-05 18:43:28 +07:00
committed by GitHub
parent 70ffeb816e
commit 9f58bf7e22
13 changed files with 69 additions and 97 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ const useDeleteFailedPost = (post?: FailedPost, deleteRedirectPath?: string) =>
const [isRetryRedirectPending, setIsRetryRedirectPending] = useState(false);
const addChallenge = useChallengesStore((state) => state.addChallenge);
const navigate = useNavigate();
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>();
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>(undefined);
const abandonCurrentPublish = useCallback(async () => {
await abandonPublishRef.current?.();
}, []);
+1 -1
View File
@@ -25,7 +25,7 @@ const usePublishPost = ({ communityAddress }: UsePublishPostOptions) => {
const setPublishPostStore = usePublishPostStore((state) => state.setPublishPostStore);
const resetPublishPostStore = usePublishPostStore((state) => state.resetPublishPostStore);
const addChallenge = useChallengesStore((state) => state.addChallenge);
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>();
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>(undefined);
const [publishPostError, setPublishPostError] = useState<string | null>(null);
const [pendingPublishRequestId, setPendingPublishRequestId] = useState(0);
const startedPublishRequestIdRef = useRef(0);
+1 -1
View File
@@ -38,7 +38,7 @@ const usePublishReply = ({ cid, communityAddress, postCid }: UsePublishReplyOpti
const resetPublishReplyStore = usePublishReplyStore((state) => state.resetPublishReplyStore);
const addChallenge = useChallengesStore((state) => state.addChallenge);
const { blockedReason } = usePublishAuthorDomainGuard();
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>();
const abandonPublishRef = useRef<(() => Promise<void>) | undefined>(undefined);
const startedPublishRequestIdRef = useRef(0);
const [resolvedExternalQuotedCids, setResolvedExternalQuotedCids] = useState<string[] | undefined>();
const [pendingPublishRequestId, setPendingPublishRequestId] = useState(0);