import { useRouter } from 'next/router'
import React, { useState, useEffect } from 'react'
const Main = () => {
const router = useRouter();
const [items, setItems] = useState([]);
useEffect(() => {
if (!router.isReady) return;
// setItems(() => router.query.text.split('/'));
}, [router.isReady])
return (
<div>
<h1>Items:</h1>
<ul>
{items.map(item => (
<li>{item}</li>
))}
</ul>
</div>
)
}
export default Main
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28