Category "reactjs"

UseEffect API Request not displaying on page load

Apologies in advance if similar questions like this have already been answered. I have tried everything, but still cannot figure out why I am experiencing this

CRA unmounts a component and mounts it back on every save

Consider the code snippet below: import { useEffect } from "react"; export const Hello = () => { useEffect(() => { console.log("Mounted"); retu

NextJs router seems very slow compare to React Router

I have a website built in React Js and the same one on Next Js as well. The problem which I am facing right now is, the router seems very slow in the nextJs com

Is there any event listener to check if the wms layer has loaded or not in google maps?

In a react web application, I am overlaying wms tiles on google maps using map's property overlayMapTypes. if (map && activeLayer) { let layer = new

Video can't press play on React

I have a working product that takes a file from API and read as a blob. But pressing the play button on the video does not work. I have tried using tried using

eact Hook useEffect has a missing dependency: ' xyz '. Either include it or remove the dependency array

I'm trying to add infinite scroll to my page but it's only showing me the mongo data. and while running react it's showing me a warning that says:- "src\compone

why does this log the old value and not the new value [duplicate]

const [title,setTitle] = useState(""); const titleHandler=e => { setTitle(e.target.value) console.log(title) } Why does this code log

How to test react component based on file reader emitted events

I have a react component called FileReader based off Dropzone react component (https://github.com/react-dropzone/react-dropzone). This file reader calls a callb

After jwt verification the state change is not presisting

So on the front end I'm using this function to have the user Log In if they have a This Function only works at the time of log in and after if the users just na

react-bootstrap progress bar - can you change the label color?

I'm using React-bootstrap to make a progress bar. Easy enough, it works: <ProgressBar className="progress" striped now={this.state.now} label={this.state.pr

React Error Boundaries not working properly with async function

So basically I wait for the Auth to return the current authenticated user from aws amplify/cognito, then I run a query to get their data(I intentionally have it

NextAuth Credentials, adding more to the user scheme

Nextauth with mysql persisting users. I'm trying out this NextAuth thing to see if this is something I like. So far so good. There is one thing tho which is bug

Cannot invoke an object which is possibly 'undefined'.ts(2722)

I have a button component. I simply pass it just one onClick prop out of many optional props I've defined: const Button = (props: ButtonProps) => { const

Creating styled-component with React.createElement

I would like to create a styled-component with a function, taking element as an argument, which I create with React.createElement call. const StyledComponent =

What are the nodes in reactjs?

I am very new to Reactjs, I have encountered this problem while I am learning react, What are nodes in reactjs, and how nodes are useful in reactjs and why we h

Why did user object is undefined in NextAuth session callback?

I use NextAuth for signIn with discord provider and I need to add userID into the session object. For that I use session callback but user object is undefined.

React: why is that changing the current value of ref from useRef doesn't trigger the useEffect here

I have a question about useRef: if I added ref.current into the dependency list of useEffect, and when I changed the value of ref.current, the callback inside o

how can i give type in getServerSideProps of Nextjs with typescript?

I'm using NextJs + TypeScript to make a little clone project, but I got a problem with type in getServerSideProps. As you can see, in getServerSideProps, I am f

Spread operator for props are not passing to component

I am having an issue passing spread operator props to components. Instead of returning a list with values, it is returning an empty list. This is how I'm passin

I have a problem entering data into an object using FOR

I have an object I want to go through using the FOR loop Because I want to change the object according to my needs Here is my original object I copied it from c