Closed johnmangam closed 2 years ago
Sorry, it's very hard to read unformatted code, it's not runnable (you have not provided a sandbox), and it's not clear what doesn't work because you haven't specified what the expected behavior is. Please use StackOverflow for questions about using React. If you think you found a bug in React, please provide a runnable example.
As @gaearon mentioned, its quite hard to read this code because its unformatted and incomplete.
At any rate, what is this supposed to do exactly ?
useEffect(() => {
if(isMounted){
data.forEach(async(s) =>{
s.isSelected = false
})
setModifiedData(data)
}
})
There are multiple things that are wrong with this code:
1- you don't have a decaled array variable called "data
" in the code, but you are still doing data.forEach
you are are receiving a prob that's called Data
with capital D.
2- Your useEffect
runs with every re-render, something I doubt you want to happen.
3- You are setting state with every re-render, which doesn't make any sense. You are also setting state with "data
", which is again, no where to be found in your code.
Checkall/uncheckall checkbox works but upon clicking the individual checkboxes the behavior isn't as expected
Code:
Grid.cs
The current behavior
Checkall/uncheckall checkbox works but upon clicking the individual checkboxes the behavior isn't as expected
The expected behavior
Individual checkboxes should be checked upon clicking it