Fetch Next
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
I change categories in the Section-Cat component. you need to pass this category to Section-Products. How to implement this correctly in next? How to raise state in react? if so, then SectionProducts will need to be made client-side. Are there other ways to keep SectionProducts server side?
4 Replies
Giant pandaOP
help me please)
@Giant panda I change categories in the Section-Cat component. you need to pass this category to Section-Products. How to implement this correctly in next? How to raise state in react? if so, then SectionProducts will need to be made client-side. Are there other ways to keep SectionProducts server side?
use
useEffect hook, rerender if category changes@Giant panda is your issue resolved
@Giant panda I change categories in the Section-Cat component. you need to pass this category to Section-Products. How to implement this correctly in next? How to raise state in react? if so, then SectionProducts will need to be made client-side. Are there other ways to keep SectionProducts server side?
Use search params to pass data to server components. See https://nextjs-faq.com/sharing-client-side-state-with-server-components