Category "react-hooks"

How to rotate material-ui icon

I'm trying to rotate material-ui icon using css property animation but not getting the desired result. Can somebody please help me identify what's going wrong h

How to check if a key is pressed/held down using event listeners and hooks in React Native?

If I need to know whether a key like the shift key is currently being pressed, how can I find that info? This solution should assign this info into a single var

Using ref with React.createElement

I've got a reusable heading component that allows me to pass a tag prop, creating any sort of heading (h1, h2, h3 etc). Here's that component: heading.tsx impor

share hooks across components

I am trying to understand how to share hooks state across components. But it doesn't seem to be sharing. Am I doing something wrong here? Home.js export default

cannot use react-spring (Uncaught Invariant Violation: Invalid hook call)

import logo from "./logo.svg"; import "./App.css"; import { useSpring, animated } from "react-spring"; function App() { const props = useSpring({ to: { opacit

MY React Web Page Does not work in an iframe

I've build a web app on react and used react hooks for my forms. However it is not working when the web application is embedded within another application. The

React native - Error: Hooks can only be called inside of a function component

I have the following problem in my component "SubmitButton" I want to execute a custom hook by clicking on the button. This hook is called "useLogin". But curre

React Hook - useEffect same code but severals behaviors

I'm new to React Hook and I follow severals tutorials but I'm afraid I'm not understand everything. I have two components with pretty much the same code but two

Change Button Text in loop using React

Is it possible to change button text that is created using array. If it is possible, what should I do with the onClick function in the button. Here is the sampl

React Typescript: Type issue when passing multiple refs to child component

I have a main component that passes down multiple refs to Panels component like so import { useRef } from 'react'; import Panels from './Panels'; export const

Why React state in localStorage is being deleted

I'm having problems to persist the state in the local storage. It's a simple todo app. After adding one todo and refreshing it, all todos are being deleted. Cou

react-hooks/exhaustive-deps warning--unclear about course of action

I am getting these lint errors ./components/create-nft/InstagramSelector.js 39:15 Warning: Effect callbacks are synchronous to prevent race conditions. Put the

How to use react-dropzone with react-hook-form?

How to use react-dropzone with react-hook-form so that the form returns proper file - not just file name?

ExportCSV using react-bootstrap-table-2

I'm trying to trigger my exportCSV from a different component outside of the TookkilProvider... is that possible? I did see some reference to this.refs.table.ha

"Uncaught TypeError: inventories.map is not a function".?

After deleting an item from the database and updating the UI with hook, I am getting this error saying "Uncaught TypeError: inventories.map is not a function".

Redux RTK not auto-generating react hooks

Could not find any info on this that explains why its not generating and how to force it to re-generate these hooks. First I thought I had to run the app to get

How to put data inside a customize state in for loop in functional component

I get the data from the API as follows: [ { "GroupA1": [ { "code": 10, "name": "item1" }, { "code": 11,

What's the difference between onClick ={ () => function()} and onClick = {function()}?

What's the difference between this code: <button onClick={()=>props.submitHandler(searchInputValue)}>Submit</button> and <button onClick={pro

Avoid rerendering when doing button.click() inside useeffect()

I'm trying to set the data from child component to parent component's state in turn that data will be assigned to input text field. And then I want to automatic

React function executes continuously and state keeps refreshing

I have kind of a weird issue in React. I am using the Blitz JS framework along side with Prisma for database stuff. I have a function that queries the database