refactor(react-doctor): raise score from 79 to 90

This commit is contained in:
plebeius
2026-02-24 15:15:44 +08:00
parent 5bd1dc0e71
commit e51f5b968c
36 changed files with 2372 additions and 1030 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
import { useCallback, useMemo, useRef, useState } from 'react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { autoUpdate, FloatingFocusManager, offset, shift, useClick, useDismiss, useFloating, useId, useInteractions, useRole } from '@floating-ui/react';
import {
@@ -47,7 +47,9 @@ const EditMenu = ({ post }: { post: Comment }) => {
});
const signer = isAccountCommentAuthor ? account?.signer : null;
const latestPostRef = useRef(post);
latestPostRef.current = post;
useEffect(() => {
latestPostRef.current = post;
}, [post]);
const onChallenge = useCallback((...args: any) => addChallenge([...args, latestPostRef.current]), []);
const defaultPublishEditOptions = useMemo(() => {