Questions tagged [react-state-management]
637 questions
0
votes
1 answer
How to fill circle border based on progress in REACTJS
How to complete the border of circle based on selected option.
Here is four options.
1.Head
2.Body
3.Script
4.End Note
And I have a circle on side. What I am trying to do is, Head is by default active so circle border should be red color till 25% of…

Mohammed Sabir
- 25
- 1
- 1
- 9
0
votes
1 answer
Possible to use React's new Context API programmatically?
I'm trying to have 1 big global state where I can perform actions, but I don't want all those actions to live in the same file.
I want to break actions out to their own files and abstract with a changeState function (like a reducer), but I'm not…

corysimmons
- 7,296
- 4
- 57
- 65
-1
votes
1 answer
color a row in Details list in reach fluent UI
How can i dynamically color a row if the value is greater than 100 and less than 1000.
here is my code

user388969
- 337
- 1
- 9
- 30
-1
votes
2 answers
Undefined state in parent when setting state in child - React
I am trying to disable a button onClick based on if the button is the "current player". I am able to successfully get the correct code in the console log from my PlayerButton component, but I also get errors from my App.js that .map is not a…

mbronstein1
- 1
- 1
-1
votes
2 answers
How to setState of an array of objects in functional components
I am trying to setState of an Array of objects when component load.
state of the component is:
const [weekdays, setWeekdays] = useState([{
day: 'S',
fullName: 'Sunday',
select: false
},
{
day: 'M',
fullName: 'Monday',
…
user20219125
-1
votes
1 answer
What are the ways of maintaining state of an object throughout the react js pages
so in our project the data will be entered on the 1st page component and we want that data on the 5th page not on the 2nd 3rd 4th page.
we are not able to maintain the state of object till the 5th page

amit chavan
- 3
- 2
-1
votes
1 answer
My Response from the database returns undefined
I am working on a login page and trying to store my data in context. But i get response from the database as undefined.
I think i am doing something wrong. Help please
Here's my code snippet
"AUTH CONTEXT" (The auth Context file returns undefined as…

pappii3d
- 69
- 1
- 7
-1
votes
1 answer
Appending a div in React using React hooks
I'm learning react at the moment and currently, making a todo app so that I can understand react more easily.
So here's what I'm trying to do:
The user clicks a button
The click fires a prompt which asks the user for the todo title (only title at…

M.Abdullah
- 77
- 7
-1
votes
1 answer
React throws too many Re-renders error when props updated in parent component
In my React Project I have one component that has 2 child components
Search Form
Employee Projects List (loads only once)
I would like to load employee projects only once on page load. Then every time search form values change I would like to…

Pavan Jadda
- 4,306
- 9
- 47
- 79
-1
votes
2 answers
How do you change state based on a click in React?
How do you do a simple useState hook based on a user action such as onClick? In the example snippet below, setCount is not allowed to be inside a function, and violates the Rules of Hooks, resulting in:
Error: Invalid hook call. Hooks can only be…

brentonstrine
- 21,694
- 25
- 74
- 120
-1
votes
2 answers
State variable shows value 'undefined' though have set default value 'false'
I created a custom component MyCustomList which is just a wrapper of FlatList. There are three props items, getMore, loading. This post focuses on the passed in loading prop only.
const MyCustomList = ({items, getMore, loading}) => {
//…

Leem.fin
- 40,781
- 83
- 202
- 354
-1
votes
2 answers
setState didn't update the set value in React
Here is the code by which I try to update the state values. I wasn't able to figure out why my state didn't get updated. I added all the respective console values at each line of code.
handleFilter=(event)=>
{
…

Pranay kumar
- 1,983
- 4
- 22
- 51
-1
votes
1 answer
conditional input box rendering
i am new in react js. i have one drop down in react js and there is two options 1. Company 2. Individual`
-1
votes
2 answers
ReactJS Redux Asynchronous Actions
I have read through lots of tutorial about using redux in reactjs but there are still few things which i am missing. Below is my action method
export const uploadFile = (files) => async (dispatch) => {
dispatch({
type: T.UPLOAD_REQUEST,
…

umer
- 1,196
- 1
- 14
- 33
-1
votes
1 answer
How to call another method from a static method in reactjs?
I just converted some obsolete events and now I am using ‘getdirivedstatefromprops’ which is static. Is it possible to call an instance method from this method?

bier hier
- 20,970
- 42
- 97
- 166