Category "reactjs"

Multiple Bottom Sheets not opening in react native Ios

Hey folks I'm using react native raw bottom sheet in react native project.I'm showing a bottom sheet when the user click on an icon.It's working fine on both an

Get the current active screen route of the tab navigator in react navigation

This is my navigation stack using react navigation v3.2.1: I have a switch navigator to switch to Authentication navigation stack and Authenticated App stack.

What is the difference between useQuery and useLazyQuery in Apollo graphQL?

I was going through the documentation of Apollo React hooks. And saw there are two queries hooks to use for which is useQuery and useLazyQuery I was reading thi

Create helper function for a (click handler) function to reuse in multiple React components

For a 'back' button I've created below (onClick) handler function in my React app. const { length: historyLength, goBack, replace } = useHistory(); const h

Props are not passing from parent to child components in React Functional component

Hi developers I'm just a beginner in React.js. I tried to print props by passing from parent to child. This is app.js file import React from "react"; im

React Flow Chart: Connect link when drop anywhere on node

I have been using npm package react-flow-chart, I can now create links between nodes using drag and drop. The issue is: I have to drop the link exactly on the p

component props not getting called on test cases

TypeError: Cannot read property 'setState' of null 251 | useStateSpy.mockImplementation((init) => [init, setState]); 252 | const component = shal

react-gtm-module appears to create an invalid src path?

It appears that react-gtm-module is creating the wrong src path. It is swapping a "/" with a ".". This is the src path as provided by Google. https://www.google

Why am I getting this error in husky (in react)?

I'm not good at English. I beg your pardon. I wanted to apply 'prettier' before commit using husky & lint-staged. So I installed 'husky@4', 'lint-staged', '

Is there a best practice for managing isLoading state?

I'm sorry for my English skills in advance. Let's say I want to fetch data from server and render it on page load...the logic is something like this: Page is lo

React-Quill - addRange(): The given range isn't in document

I am trying to make a simple blog using React-Quill text editor. I want to get the value of the ReactQuill Editor and preview it on a different route. I've been

How to call an individual modal box component in react?

I wanted to open/load a react bootstrap model box component (Modalbox.js) to App.js, but the modal box open button code in App.js, how to do that? please help.

create-react-app + npm start - 'react-scripts' is not recognized as an internal or external command

Similar questions that I have tried following "npm-run-all" is not recognized as an internal or external command "'react-scripts' is not recognized as an inte

react-select debounced async call not displaying suggestions

I'm using react-select loading the results from an api and debouncing the queries with lodash.debounce: import React, {useState} from 'react'; import AsyncSele

Getting req.headers is undefined when trying to read from req object in NextJS

On page load, I try to fire off an authentication request if a token exists in local storage. // utils.ts const init = async () => { try { const

local storage is not persistent in react app

I am creating a react app which is using local storage. I am saving and array of objects to local storage. when I try to save to local storage the data is savin

Disable Screen Capture/ScreenShot in React Native App

I have came across few solutions specific for ios and Android to prevent screen-capturing and taking screenshots. But how do i disable screen-capturing in react

useState() undefined in React just after set

I have a problem and I do not undersatnd why the hook return undefined : import React, { useEffect, useState } from 'react'; function App(){ const [globa

Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'. Type 'null' is not assignable to type 'Element'.ts(2345)

I have index.html <body> <div id="portal"></div> <div id="root"></div> </body> and want to use the component below

Input Fields lagging in React

I am a beginner at frontend and not even sure if this is the right place to ask this question but a developer has created a react app and when data is thrown in