Relative Content

Tag Archive for reactjstypescriptnext.js

Fetched API data is being cached Next.js 14.2.8

My application has an API that has dice roll function it works as intended when running in development mode but when I build for production the data in the first API call becomes cached and the data on the page is not updated when the API is called for a second time.

Functions passed as props to several functional components don’t update common variables correctly

I have been working on a navbar functionality in next.js. I have two functions (for the mobile interface of the website) that respectively close and open the navbar, using a hamburger menu (for opening it) and an X icon on the navbar (for closing it). These two functions are defined inside the page export (see code below) and update local variables defined in the page export, after which they are passed down as props to the hamburger component and the navbar component.