Category "reactjs"

Module not found: Error: Can't resolve the typescript file when adding typescript to a CRA app

I'm trying to add typescript to my project and write new components with typescript. I followed the documentation but I'm got this error:can't resolve [the type

Web3: Cannot read properties of null after new ethers.Contract

I am trying to use a smart contract just after I instantiate it. However, I get an error: Uncaught (in promise) TypeError: Cannot read properties of null (read

How do I get useEffect to run on array sort? [duplicate]

I have an object like this const example = [{medicineName : "Some name" medicineId : 1} {medicineName : "Some other name" medicine

How to resolve the error: Module '"react-hook-form"' has no exported member 'useForm'

I want to make simple login page using react-hook-form I get this error: Module '"react-hook-form"' has no exported member 'useForm' import React from 'react'

Problems with installing SASS React

I want to install SASS to my react app. I try yarn add node-sass my console return error: ./src/comopnents/Form/Form.scss (./node_modules/css-loader??ref--6-one

react testing library: can't acquire context from the given item

I have this component, which uses react-chartjs-2 to render a Doughnut chart: const CompliancyChart = ({data}): JSX.Element => { ... return ( <Cha

npm error ENOTEMPTY on babel-loader while npm install

I am trying to install a new dependency and I get this error. Any hint to fix this please ? Thanks! ==> EDIT : I tried to delete that folder and run the npm

blank/white page error in react js app ( stopped working in chrome and edge all of a sudden)

I have a react app which is in production for few years now, everything was working just fine but all of a sudden a it has stopped working (only a particular fu

iframe element not rendering in IOS devices

works fine in all windows but not in iOS devices. Video show ok on windows but in ios not render the video. render() { return ( <> <iframe s

My timer in Reactjs is not working correctly with a delay

My timer in Reactjs is not working correctly with a delay... I noticed that over time, my timer starts to lag if I switch to another browser tab or window. Why

I do not understand the difference between redux and react-hook-form. What is the difference?

I do not understand the difference between redux and react-hook-form. What is the difference? (I am only somewhat aware of the fact that both are tools to manag

Testing React Component with React Router V6

I understand that React Testing Library has an example of testing with react router, but I couldn't get it to work (I think because I am using react router V6).

Redirect 404 to homepage in Nextjs with dynamic routes

I am trying to redirect 404 pages to the homepage in Nextjs, but because of a rule in the next.config.js it does not work. Every other 404 redirects to homepage

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