import React, { MouseEventHandler, useEffect, MouseEvent } from "react"; import { BrowserRouter, Route, Routes, Link, Outlet, useSearchParams } from "react-router-dom"; import Theme from "./theme"; import getUrl from "../url" // const initSearchParams = ["theme", "city"] const initSearchParams = { "theme": "1", "city": "1" } export default function Body() { const [searchParams, setSearchParams] = useSearchParams(initSearchParams) useEffect(() => { console.log(searchParams.get('theme'), searchParams.get('city')) setSearchParams(searchParams) }, []) const handleClick = (event: MouseEvent) => { console.log(`theme id= ${event.currentTarget.id}`) } // const imgs = [1, 2, 3, 4, 5] let url=getUrl(); return (
01
02
03
04
05
06
07
08
09
10
{/* citylist */}
{url.map(url => (
{url.url}
))} {/* pic */}
// Body Page ); };