Questions tagged [react-state-management]

637 questions
-1
votes
1 answer

Detect click outside a component react way NOT dom access

I am implementing a crop feature with React. When the user right clicks, a context menu appears. In the context menu, a user can select crop item. When a user selects crop, cropping gets activated. Now, I want to close the cropping state when the…
vam
  • 492
  • 7
  • 17
-1
votes
1 answer

Toggle show hide class on child component from parent onfocus method in React

I am a React beginner. I have a Parent component that has multiple input fields (InputField child component). OnFocus I want to toggle a child of Inputfield(InputFieldToolTip component) to show/hide from a method in the parent component Currently,…
Barry Watts
  • 784
  • 2
  • 14
  • 43
-2
votes
1 answer

Why am I getting undefined prop?

Below is my Header component in react: import React from 'react' import {AppBar} from '@material-ui/core' import {Typography,Container,Toolbar,Select,MenuItem} from '@material-ui/core' import {useNavigate} from 'react-router-dom' import {…
-2
votes
1 answer

Why is my object in React showing an undefined Object value?

Here is my React component: const ChartItem = ({ id, apiUrl }) => { const [nivoChartData, setNivoChartData] = useState([]); // //declare the API call const apiCallAndConversionForNivoFormat = useCallback(async () => { try…
-2
votes
1 answer

How do you organize a reducer that has over 100 actions?

If you have over 100 actions in your reducer that causes your file to have over 2k lines of code. How would you go about architecting the files, the state, and folder structure of your project. let state = { car: { [id]: { //…
Xavier
  • 313
  • 2
  • 5
  • 18
-2
votes
1 answer

How to solve the React error: Cannot read 'Props' of undefined

I'm trying out to work on integrating a library called react-phone-number-input with my multi-step react form as per the following as a functional component: import React, { useState } from "react"; import Helmet from "react-helmet"; import…
-3
votes
3 answers

How to JSON.stringify an nested array of objects

This is my data, data = { "SeatingArrangement": [{ "data": [{"id": 1, "rowName": "a", "seatNo": 0},{ "id": 2,"rowName": "a","seatNo": "a1"}], "rowName": "a", }], "TheatreName": "abc natyadalan", …
1 2 3
42
43