Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@
"@storybook/react": "^10.3.5",
"@storybook/test": "9.0.0-alpha.2",
"@types/node": "~24.12.2",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"antd": "^6.3.6",
"chromatic": "^16.3.0",
"execa": "9.6.1",
"fs-extra": "11.3.4",
"lottie-web": "5.13.0",
"nano-staged": "^0.9.0",
"prettier": "~3.8.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"rimraf": "~6.1.3",
"semver": "7.7.4",
"simple-git-hooks": "^2.13.1",
Expand Down
691 changes: 336 additions & 355 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/blog-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
import type {
AnchorHTMLAttributes,
HTMLAttributes,
ReactElement,
ReactNode,
} from 'react';
import { useMemo, useState } from 'react';
import { type BlogAvatarAuthor, BlogAvatarGroup } from '../blog-avatar';
import { ALink, type LinkComp } from '../shared';
Expand Down Expand Up @@ -200,7 +205,7 @@ function MarkdownishText({
type BlogCardProps = {
post: BlogListItem;
isFeatured: boolean;
Link: (props: LinkLikeProps) => JSX.Element;
Link: (props: LinkLikeProps) => ReactElement;
dateFormatter: Intl.DateTimeFormat;
interactive: boolean;
renderInlineMarkdown?: RenderInlineMarkdown;
Expand Down Expand Up @@ -297,7 +302,7 @@ export function BlogList({
return emptyState ? <>{emptyState}</> : null;
}

const Link = (LinkComp ?? ALink) as (props: LinkLikeProps) => JSX.Element;
const Link = (LinkComp ?? ALink) as (props: LinkLikeProps) => ReactElement;
const dateFormatter = new Intl.DateTimeFormat(
lang === 'zh' ? 'zh-CN' : 'en-US',
dateFormatOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/hero/BackgroundStar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const BackgroundStar = ({
pageY: number | null;
size: number;
}) => {
const ref = useRef<any>();
const ref = useRef<HTMLDivElement | null>(null);
const [transformX, setTransformX] = useState<number>(0);
const [transformY, setTransformY] = useState<number>(0);
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const positions = [
];

const useMouseMove = () => {
const ref = useRef<any>();
const ref = useRef<HTMLElement | null>(null);
const [pageX, setPageX] = useState<null | number>(null);
const [pageY, setPageY] = useState<null | number>(null);

Expand Down
4 changes: 2 additions & 2 deletions src/shared.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AnchorHTMLAttributes, ReactNode } from 'react';
import type { AnchorHTMLAttributes, ReactElement, ReactNode } from 'react';

export type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
className: string;
href: string;
children: ReactNode;
};

export type LinkComp = (props: LinkProps) => JSX.Element;
export type LinkComp = (props: LinkProps) => ReactElement;

/**
* A backup link component, import { Link } from '@rspress/core/theme' to replace it
Expand Down
2 changes: 1 addition & 1 deletion src/why-rspack/useCardAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const useCardAnimation = () => {
const [pageX, setPageX] = useState<null | number>(null);
const [pageY, setPageY] = useState<null | number>(null);
const [isHovering, setIsHovering] = useState(false);
const ref = useRef<HTMLElement>();
const ref = useRef<HTMLElement | null>(null);

const handleMove = ({ pageX, pageY }: { pageX: number; pageY: number }) => {
setPageX(pageX);
Expand Down
4 changes: 2 additions & 2 deletions src/why-rspack/useLottieAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const useLottieAnimation = (
isHovering: boolean,
lottieJsonData?: string,
) => {
const ref = useRef();
const ref = useRef<HTMLDivElement | null>(null);

const animationRef = useRef<AnimationItem>();
const animationRef = useRef<AnimationItem | null>(null);

useEffect(() => {
if (!ref.current) {
Expand Down
Loading