Skip to content
Advertisement

Tag: react-hooks

Replicate element in React

Hello thanks for the help, with the following code in react I want to replicate the click button every time I click on it. Currently nothing happens, but if the console shows that the array grows. Here the sandbox: https://codesandbox.io/s/charming-glitter-0ntxmj?file=/src/App.js Answer Updating a local variable in a function component doesn’t work that way. It behaves just like a normal function,

Advertisement