Category "react-hooks"

React - Error, Hookrouter invalid hook call

can't handle this error any suggestions? import "./App.css"; import { navigate, useRoutes } from "hookrouter"; const routes = { "/": () => <h1>h

React useContext to pass person object from signup to phone verification

I working on a portal using react and I am trying to pass the form data which is an object from the signup page to the phone verification page so I can verify a

Why does useEffect React Hook not work properly with dependency?

I'm working at a React Web App with Fullcalendar. I think one does not need to know Fullcalendar in order to answer this question. It's rather a matter of React

(Apollo client v3) useLazyQuery custom hook testing

I was struggling with a test issue for my custom useLazyQuery hook. My first test is passing but the second one is failing. What am doing wrong for the second t

Is it possible to pass props from a React Link to a functional component?

I have a sign up/sign on page, and I want to redirect the user to the last page that they visited on the site before they tried to sign up/sign on (or their pro

dom is not updated after state change via Context API

I am quite new to React and tried to finish a project on FrontendMentor. It's basically a simple OPA of an online store with just one product and the ability to

Unable to mock react-redux hooks after migrating to 8

I have been using the following pattern to mock react-redux hooks in tests that use Enzyme shallow rendering: import * as redux from "react-readux"; ... jest.sp

Why isn't my React context being updated?

When I use the app and navigate to the SetContext component, I see the value of auth is correct ("dummy value") and after entering a value in the edit field and

react-video-js-player "No compatible source was found for this media"

I am working on a 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

React Transition Group: How to pass ref to mapped component to avoid Warning: findDOMNode is deprecated in StrictMode (still not working)

I am using "React Transition Group" ver 4.4.2 to animate menu buttons (CSSTransitions mapped inside TransitionGroup), but when I click them ones or a couple of

Module '"react"' has no exported member 'SuspenseList'. TS2305

I'm trying to learn some of the new features in React 18, such as the SuspenseList and new useId hook, but I seem to be getting the same error over and over: Mo

how to know if i should use redux for my application or any other alternative?

I am new to react native and mobile development world. I am developing a mobile application with react native, it's basically an entreprise management app for H

setState inside useEffect doesnt update UI

i am trying to fetch multiple endpoints in UseEffect and depending on it's result show data on the UI (avatar, username, etc.) Problem is, that the data receive

React useState - using one State per component vs multiples states? [closed]

What is a better way to optimize and do the code more readable in React using Hooks / Functional components; Having a single setState hook or

IntersectionObserver with React & Hooks

I'm trying to track element visibility with React/Hooks and the Intersection Observer API. However, I can't figure out how to set up observation with "useEffect

sort an array with react hooks

I'm doing a simple sort of an array with react hooks, but its not updating state. Can anyone point out what I'm going here? import React, { useState } from "re

MUI Datagrid duplicate row and data

I want to know if there is a way to duplicate the specific row with data on it using material-ui Data Grid? I hope someone could help me. Thanks in advances! Bt

Why need useRef and not mutable variable?

I have read A Complete Guide to useEffect - Swimming Against the Tide at Overreacted. The example shows that if we want to get the latest count, we can use us

TypeError: navigation.toggleDrawer is not a function. (In 'navigation.toggleDrawer()', 'navigation.toggleDrawer' is undefined) this error occured

TypeError: navigation.toggleDrawer is not a function. (In 'navigation.toggleDrawer()', 'navigation.toggleDrawer' is undefined) I've called this function as chil

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