Chore(Deps): Update
更新 Remix 和 React 版本尝试修复
This commit is contained in:
@@ -51,7 +51,7 @@ function Pagination({ current = 3, total, size, onClick }: PaginationProps) {
|
||||
<div>
|
||||
{arr.map((item, index) => {
|
||||
if (typeof item === "string") {
|
||||
return <span className="p-2 mr-2">{item}</span>
|
||||
return <span key={index} className="p-2 mr-2">{item}</span>
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { LinksFunction } from "@remix-run/node";
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
@@ -76,7 +75,6 @@ export default function App() {
|
||||
<Outlet />
|
||||
<Footer />
|
||||
<ScrollRestoration />
|
||||
<LiveReload />
|
||||
<Scripts />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -27,10 +27,6 @@ export default function Note() {
|
||||
const [params, setParams] = useSearchParams();
|
||||
const { note, page, year } = useLoaderData<typeof loader>();
|
||||
|
||||
useEffect(() => {
|
||||
console.log(note);
|
||||
}, []);
|
||||
|
||||
const onChangeYear = (ev: ChangeEvent<HTMLSelectElement>) => {
|
||||
navigate({
|
||||
search: `?year=${ev.target.value}`,
|
||||
@@ -88,7 +84,7 @@ export default function Note() {
|
||||
onChange={onChangeYear}
|
||||
>
|
||||
{years.map((year) => (
|
||||
<option value={year}>{year} 年</option>
|
||||
<option key={year} value={year}>{year} 年</option>
|
||||
))}
|
||||
</select>
|
||||
<Pagination current={Number(page)} size={7} total={note.count} onClick={onChangePage} />
|
||||
|
||||
Reference in New Issue
Block a user