Skip to content
Advertisement

Tag: react-hooks

React never ending loop in useEffect

Apologies. React noob here. Got an issue where my code has stuck on a never ending loop. I’ve stripped the code down only to the part I believe that’s causing the problem. I’ve used the useEffect method to match the componentDidMount. Is that correct? The moment I comment “setPackages(resp1);” the never ending loop stops. I probably am using the useEffect

useState and useHooks in HTML

first of all, I can not use the “create-react-app” command in the current project. so here I am trying to add my react code into a plain HTML file. Here are my codes for HTML and js files. can anyone tell me why my hooks and setState don’t work properly? Please guide me to solve it. my like_button.js codes Answer

React hooks: Why do several useState setters in an async function cause several rerenders?

This following onClick callback function will cause 1 re-render: React lumps all three state changes together and causes 1 rerender. The following onClick callback function, however, will cause 3 re-renderings: It’s one re-render for every useState setter. Furthermore the order of the setters influences the values in each of these renderings. Question: Why does the fact that I make the

React useState conversion

I made a static webpage app that I have been slowly converting to React (MERN stack) to make it more dynamic/so I won’t have to configure each and every HTML document. It’s a product configurator that uses Google’s model-viewer. I’m fairly new to using a full-stack workflow but have found it pretty fun so far! I am having trouble however

How to get the sum of values for inputs Tags that change dynamically (number of inputs change dynamically according to number of days in a month)? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m trying to calculate the sum of values inputted (the number of inputs change dynamically) This is the function that returns the number of inputs:

Advertisement