docs(plan): lazy import lands with first reader wiring (noUnusedLocals)
This commit is contained in:
@@ -1619,7 +1619,7 @@ export function useProgressSaver(bookId: number): ProgressSaver {
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { lazy, Suspense, type ComponentType, type LazyExoticComponent } from "react";
|
import { Suspense, type ComponentType, type LazyExoticComponent } from "react"; // lazy 自 Task 7 起随首个 READERS 条目补进本行(noUnusedLocals)
|
||||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||||
import { api } from "../api/client";
|
import { api } from "../api/client";
|
||||||
import type { Format } from "../api/types";
|
import type { Format } from "../api/types";
|
||||||
@@ -2041,7 +2041,7 @@ export default function CbzReader({ book, initialLocator }: ReaderProps) {
|
|||||||
|
|
||||||
- [ ] **Step 5: `src/pages/Reader.tsx` 接线 cbz**
|
- [ ] **Step 5: `src/pages/Reader.tsx` 接线 cbz**
|
||||||
|
|
||||||
`READERS` 整块替换为(lazy 动态导入,不新增顶部静态 import,保持 code-splitting):
|
先把 react import 行还原为含 `lazy`(见 Task 6 注释),再整块替换 READERS:
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
const READERS: Partial<Record<Format, LazyExoticComponent<ComponentType<ReaderProps>>>> = {
|
const READERS: Partial<Record<Format, LazyExoticComponent<ComponentType<ReaderProps>>>> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user