Skip to content
Advertisement

Tag: apollo-client

Saving the state of the button onClick

I have: This pattern works fine, but whenever on the page more then 1 attribute and user select more then one, previously selected button gets unclicked. My question is: How can I save the state of 1st selected button after clicking on 2nd one? for each attribute only one button can be active buttons name should be used Answer You

Best practice for Next.js data fetching inside a component

I have a menu component that appears globally. What is the best practice for getting data into that component? I’m trying to take advantage of static generation that Next.js offers but all data fetching guidance from the Next.js team relates to pages. getStaticProps and getStaticPaths seem to pertain to page generation, not data for components. Is their SWR package the

Advertisement