0
Well, my doubt may be a little unethical, but either way, it’s something I’m curious about. Am I required to set a state for all events on the screen? Let me try to explain... I have a list of users that I return from an API, for each user I show the id, name and type of user(admin, etc.). Only I have two features in this list to disable the user and edit it, when I click to edit I call a function that takes the id and the value "flex", in this function I get q div who owns the id using the javascript api of manipulating the DOM and give a style.display = value(which is "flex" or "None"). Is that good practice? Or would I have to set a state to give the toggle and if yes, how could I do that.
wrong to do so:
style.display = value(que é "flex" ou "none")
– novic
And how could I do that?
– Luiz Utzig
missing you post a minimum example of your code
– novic
I did some research, and I saw that I had to create a separate component for what will be covered. I did and it worked, I can make the toggle in a cleaner way. I ended up separating in 3 components s what was only 1
– Luiz Utzig