Category "reactjs"

React difference of using value in state vs value in object in state

I am getting different behaviour depending on whether I am using a boolvalue on with useState, or whether I am using a bool value inside an object with useState

nextjs and bootstrap5 modal

Hello I would like to use bootstrap 5 without react-bootstrap and reactstrap when I create my modal I end up with this error: TypeError: undefined is not an obj

Update custom hook's variable after initial call

I created a custom fetch hook called useFetch() and initialled it in my App.js component, to render a list of movies when the web app loads up the page. I am tr

How to add custom indicator in trading view Charting library in reactjs

I have trading view charting library i'm working on it but now i want to add custom indicator in it but i don't know how to do.

Assigning ScrollTo value cause unexpected flickering/blinking on iOS devices

We recently worked on an auto-scrolling while freely swipeable component using React.js. The implementation idea is inspired by this article And we've made some

How to properly change a array of object to another array of object in TypeScript [closed]

How to properly change a array of object to another array of object in TypeScript? a : [ {bcdbcd : 1, abcabc : "value1"}, {bcdbcd : 2, abc

invalid url for nextjs image

I am writing the frontend of my application with nextjs I am trying to load image from the public folder but I am getting invalid url I copied the image to the

React project Error: Map container not found

I have a ts project written with React, I want to render a simple map an a rightsider but I got an error report "Error: Map container not found."Below is my met

Is there a way to accept image as props in react component?

I am following react tutorial teaching by Bob Zirol in freecodecamp; in my App.js I have rendered a Card.js component which I passed an image as props; so how c

How to use Turborepo for an existing react app created with Create React App in order to make it a monorepo?

I have a fun project made with create react app. I want to convert the same application to a browser extension. This idea forces me to make the project a mono r

React - Enzyme mount throwing regeneratorRuntime is not defined error

I am trying to test the following component: class SearchComp extends Component { constructor(props){ super(props);

react-router-dom v6 StaticRouter context is not working

I'm trying to make SSR React web application. Everything works fine except staticContext. My server code is // IMPORTS const renderer = (req, store, context) =

react-router-dom v6 for google analytics

So in a previous application for using Google Analytics i had this component for a <RouteChangeTracker/> this component would listen to the url change, an

Installing dependency produces: ERESOLVE unable to resolve dependency tree

When I try to install a dependency I get the following error. How can I fix this? npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm

plane detection with react-three/xr

I`m using react-three/xr and react-three/drei in my next.js project. This code put the 3d model i an static position. const Test: NextPage = () => { return (

How to dynamically draw edges between nodes using jsplumbtoolkit-react

I'm using jsplumbtoolkit-react 2.x version. Using toolkit.addNode to add new nodes dynamically to the graph. But I'm struggling to draw the connection between t

React-URLSearchParams returning Null object

I am using the following code to retrieve query parameters from URL but URLSearchParams returns an empty object. PS: uselocation.search returning correct output

'conditional' css in next/react

I'm trying to apply styling depending on the element's parameters. I've tried to search for "conditional css react", "conditional react style in css" and other

Unable to set theme in latest MUI v5 with ReactJS

I am building a small, simple Wiki for myself; just started learning React, although I've been working with JavaScript before. I cannot seem to set the theme. I

React - Why is geolocation state undefined when accessing it from another function

I'm trying to get the latitude and the longitude from geoLocation and use it to fetch data from a weather api. The problem however is that as soon as I pass lat