Category "reactjs"

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

Redirect Router after loggedin

Am trying to Redirect router to "/", without login it set to Landing.jsx, After login needs to redirect to Homepage.jsx which is also in same route "/". tried u

Cannot access local server using localhost but works via IP

I'm viewing a locally hosted website (React ). I can view it via IP http://192.168.1.100:3000/ (192.168.1.100 is my local IP address), but not via http://localh

Why is Graphql data object only available outside the call function

I am new to graphql and react so I can't figure out why the loaded data return object is only available outside the mutation post which produced the data. Could

Is there a way to get RGB value from a live camera feed in reactJs?

I was wondering in ReactJS/ReactApp if it is possible to capture the RGB color from Center Pixel of a Live Camera Feed displayed on a website (honestly any pixe