I have datas from getStaticProps. Bu I have problem when I get data inside function. I don't know how can I get.
export async function getStaticProps(){
const res = await axios.get(`https://dummyjson.com/products?limit=10&skip=${page*10-10}`)
const data = res.data
console.log(data)
return{
props:{
products: data
}
}
}
this is my getStaticProps. I need to this page from useState
export async function getStaticProps(){
const res = await axios.get(`https://dummyjson.com/products?limit=10&skip=${page*10-10}`)
const data = res.data
console.log(data)
return{
props:{
products: data
}
}
}
function Filter( { products } ) {
const [page, setPage] = useState(1)
I don't know how can I get thi data