Skip to content
Advertisement

Tag: reactjs

No component being rendered on router.push(‘/page’) unless reloaded

On successful login, I’m embedding the user token in browser cookies and using router.push(‘/dashboard’) to take the user to his dashboard, but the ‘/dashboard’ page is not rendering any components unless I trigger a reload, on which all the components are rendered on the screen. Code block from /login page: Code block from /dashboard page: which on first returns a

ReferenceError: FileReader is not defined in Next.js

I am trying out the new functions of Next.js 13 with the /app folder, but in a simple client-side component that handles an input form, I am trying to use FileReader but receive an error when browsing. This is the summary of the code: Error: What am I doing wrong? Answer Like accessing window, any browser-specific code in Next.js needs

why can’t access the function inside the listener

I am using a class component. When I run this script, it plots the graphic, but in the next line when it calls the function computePM_from_ClickedPoint, I get the error below. The error refers to “this”, but without it, I cannot call the function. Suggestions? Error: Cannot read properties of undefined (reading ‘computePM_from_ClickedPoint’) tried unsuccessfully changing the call to: Answer

How can I position my autocomplete box under the search box?

Hello I’m trying to create a custom suggestion box for search box. The parent div is flex box and suggestion box is positioned absolute. but the top and left property of css. It is taking of global page and not parent. You can see in css “suggesetionbox” the top property is targeting complete page not parent div. Can someone suggest

Unpredictable state change

I am dynamically creating mathlive fields and adding them to the DOM. Though it isn’t a good way but doing it like this because I wasn’t able to add the element as a React component and I needed a workaround quickly Now when I remove an element from array responsible for rendering the elements, it works as expected but when

Advertisement