Relative Content

Tag Archive for javascriptreactjstypescriptnext.js

Variable not updating in loop TS

I can’t get the àmount to update! This loop is inside another for loop, but the first if on this code logs the correct amount as it updates, however the first console.log on top keeps logging 0 instead of the new values. This is ruining my code because the amount being pushed to the array is also the zero instead of the correct value, updated previously.

NextJs only works when page is reloaded

very new to NextJS and I’m running into a problem with a third-party ebay script I’m trying to display on one of my routes page. It only seems to display sometimes when I reload. When the page is changed to the store page through a link/route, it does not display anything.

Why do I get an error when I send data to the server?

Why do I get an error when I send data to the server? I’m creating a form to login to a site, but I’m getting an error saying the JSON is invalid. Output upon sending: Uncaught (in promise) SyntaxError: Unexpected token ‘<‘, “<!DOCTYPE “… is not valid JSON Code: const handleSubmit = async (event: FormEvent<HTMLFormElement>) […]

Issue with the loading.tsx file in Next.js

I want to implement loading ui in my app by adding loading.tsx files to route segments:
File system.
But the problem is that when I add the loading.tsx file to the /jobs and /jobs/[id] route segments and navigate to the /jobs/[id] route from the /jobs route, I get almost infinite page loading.