Category "react-hooks"

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

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

Do react hooks work via CDN links in a simple single html file?

What is wrong with the following html & js, I can't use hooks! ... this is the only file in my project (no other files or package managers) <html> <

How can I 'not allow' the user to retrieve same information from the server multiple times in my 'React' Weather-app?

I'm learning React and as a practice I'm building a weather-app. My App Photo Everything is ok. but I want When a User type a City name for example 'London' and

Type 'Dispatch<SetStateAction<any[]>>' is not assignable to type '(values?: string) => void'

I'm very new to typescipt and trying to make a basic pin-input page. Sandbox link for my code . Although it is working, I'm getting this error for onChange func

React console.log showing duplicate results in Dev Tools

Why does React show duplicate console.log? I found that to remove StrictMode from index.js. but there was no such problem before and why did I remove StrictMode

Confused about how to create a ref if there is no forward ref?

There are three options, I don't know which one is the best. //@ts-nocheck import React, { useEffect, useRef } from "react"; export const Child = React.forward

TypeError: getTodosFromUserDevice is not a function Also TypeError: saveTodoToUserDevice is not a function

I have created a todo list and it works fine, but I need to add async storage to store the todo list when the page refreshes, or closes etc. So, I added async s