minor tweaks to loading. move it outside the return.

This commit is contained in:
iamBadgers committed 2026-10-20 17:19:47 -07:00
1 parent c355e55d67
commit 2a61649fcb
7 files changed
+57 -117

No files matched your search

+9 -13
View File
@@ -4,21 +4,17 @@ const baseUrl = typeof window !== 'undefined'
? window.location.origin
: process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env
const st = await fetch(`${baseUrl}/characters/collateral/stats.json`)
.then(r => r.json());
const sk = await
fetch(`${baseUrl}/characters/collateral/skills.json`)
.then(r => r.json());
export function Fighting() {
const [stats, setStats] = useState([])
const [skills, setSkills] = useState([])
useEffect(() => {
fetch(`${baseUrl}/characters/collateral/stats.json`)
.then(r => r.json())
.then(j => setStats(j))
fetch(`${baseUrl}/characters/collateral/skills.json`)
.then(r => r.json())
.then(j => setSkills(j))
})
const [stats, setStats] = useState(st)
const [skills, setSkills] = useState(sk)
return (
<main>