I have custom React hook which adding some scripts and add a variable to window object: I am using Apollo client and GraphQl for fetching data. In ...
I have custom React hook which adding some scripts and add a variable to window object: I am using Apollo client and GraphQl for fetching data. In ...
I created below two functions, to add and remove external src and <script> tags in my React app: I can then use it like: Since I am using ...
I am trying to pass a string value in a custom hook call to the hook file itself. For example, I have a json file I want to pass to a custom hook to g ...
I've made a custom react hook called useAxiosPost which makes a post request to an endpoint. But I also want to perform some action to the data return ...
It is difficult for me to understand this custom React hook. The code works, but I understand only some parts. It is a useLocalStorage hook. I will be ...
So I have a custom hook that controls the theme (dark/light mode) using tailwind and I have two images that alternate between the two modes. I'm tryin ...
I want to use a useState hook inside my HOC, but that prevents the component from being rendered here is my component and this is my HOC which the ...
I want to know which approach is better in which scenario: React custom hooks for http requests, where we put states for loading, error and data a ...
I've a custom hook being called by multiple components, including other custom hooks. I added an useEffect in the custom hook to run on only initial r ...
It's react-custom-hook. Returns functions that can utilize multiple methods of indexedDB that operate asynchronously. The variable db has objects t ...
I have a component which has a function in it. also I have a custom hook name "useHook-A" I want to call my function which is inside the component thr ...
So, I have a superrrr basic setup here. All I'm trying to do is test whether or not the hook was called/initialized from the component that I wa ...
I created a custom hook which takes a url and return the data import { useEffect, useState } from "react"; export function useHttp({ url }: { url: s ...
Im trying to implement a timer to distinguish between single click and dbl click events so the single click does not fire when dbl clicking. Edit: I ...
Hello :)) I not familliar with custom hook in React. I have tried simple ones, but example below I don't know how to resole I want write a hook that ...
I have created a custom hook in my nextjs app, where i create an axios instance. It looks as follows: In the hook i want to use dispatch, but curre ...
I know this is gonna be messy and terrible but while I have the TypeScript basics down, I'm having trouble typing the more advanced concepts, particul ...
I'm trying to iterate over an array in a custom hook in order to use an img, however the img doesn't display. What am I doing wrong as I don't want t ...
I'm currently going through some tutorial about React Design Patterns, subject: Custom Hooks. While the concept feels awesome and seems familiar to me ...
I'm trying to use a hook inside of a useEffect call to run only once (and load some data). I keep getting the error that I can't do that (even though ...