KCIBUR
KCIBUR
TTCTheo's Typesafe Cult
Created by Jonker on 2/15/2024 in #questions
NextJS14 Server Action Refresh page
Hi! import Router from 'next/router' Router.reload(); Should do full page reload
4 replies
TTCTheo's Typesafe Cult
Created by Ted on 2/15/2024 in #questions
Next wont load images.
Hi! Make sure that cardValue\cardSuit have values when next\image trying to render it first time.
If it still doesn't work you can try to get images with const imageSrc = require(${card}) and then use them in next/image as src={imageSrc} . You can add memo to optimize this method. I think you don't want to preload whole folder of images when users opens some page , that will hit your page speed.
4 replies
TTCTheo's Typesafe Cult
Created by Xaohs on 2/15/2024 in #questions
App directory fetch data from endpoint with query parameters
Hi! @Xaohs 1. You can get params directly from page props for example Page({ params}) and get rid of useParams hook in this server component. 2. Hooks can be used only in client components because they often use useState,useEffect which is not allowed in server components. You can try it , and if you still have questions, I will be happy to answer them to the best of my ability.
4 replies