Posts by Rindi • 73 points
7 posts
-
0
votes1
answer43
viewsQ: How to add new object at specific position of useState Hooks array
I have the following state in hook on Reactjs: const[faixas, setFaixas] = useState([ {albumId: 1, nome: "nome da musica"}, {albumId: 1, nome: "nome da musica"}, {albumId: 2, nome: "nome da musica"}…
-
-1
votes1
answer54
viewsQ: How to put optional parameter in Reactjs
I need to send a request, but there is a parameter that is optional, and I must only send it on one condition. It’s like this: const [blocoSelect, setBlocoSelect] = useState("nenhum"); params: {…
-
-1
votes1
answer43
viewsQ: How to change some attributes of an object with Hooks
I want to update only some attributes of an object, these attributes are varied, one time I want to update some, another time. Follow the example: const [myObject, setMyObject] = useState({…
-
0
votes0
answers27
viewsQ: Error installing SQL server - Linux Mint
I already have flask installed on my NOTEBOOK with Linux Mint, but still no module called flask is showing up along with dpkg error. I tried various solutions on various websites such as: sudo dpkg…
-
3
votes1
answer459
viewsQ: How to put objects in empty array with React Hooks
I have the following data set: const dados = [5, 10, 15, 20, 25, 50, 90]; const colors = [ "#52DF9A", "#FFCE1C", "#3570BD", "#3570BD", "#00B894", "#FB6B32", ]; And I’ve got the following state:…
-
1
votes1
answer69
viewsQ: How to change state of an object attribute with React Hooks
I have the following status with React Hooks: const [active, setActive] = useState({ card1: false, card2: false, card3: false, card4: false, card5: false, card6: false, card7: false, }); I would…
-
0
votes2
answers1471
viewsQ: How to change color of a div with button click on Reactjs + CSS
I’m trying to change the color of div with button click, apparently it was supposed to work, but it only works on the second click, I don’t understand. The code is like this : The function I change…