Closed askeroff closed 6 years ago
Example of the problem (Click edit, mark all checkboxes, press ok, look at the console, then edit another item, don't touch checkboxes at all, press ok, look at the console, and you'll see the problem).
Found the solution. Solution here
I have a list of components rendered. Each component has an edit button. When you edit and press ok, sweet alers pops up, and it should have the checkboxes in it, for the user to specify some options.
The Code
The Problem
First time around, I get the default values true false. But suppose this: User marks all checkboxes when swal pops up, presses enters, edits another thing. Pop up open withs all the checkboxes marked, but the actual data is the default one [true, false]. I understand why this happens, but I can't figure out how to fix it.
Can someone explain how you would do that in react? I woudl like this either to open up each time popup with default values or hold actual data based on the state of that component.