Skip to content
Advertisement

Tag: react-hooks

Paging in react

good morning, how are you? I’m having a problem with pagination, when I click to change the page it appears the page results and goes back to the first one right away, would you know how to help me? For example, if I click on page 2, its results appear but it immediately goes back to page 1, I don’t

Can I get away with not using useEffect in this instance?

I’m still learning React and the proper way to do things. In this React project I am using the TinyMCE editor: https://www.tiny.cloud/docs/tinymce/6/react-cloud/ I want to display a warning message about unsaved changes once the editor has been made “dirty” that is that the user has modified the default content you get on reload. The component that contains the editor has

React’s useRef hook doesn’t take a function?

I’m used to passing functions to useState, so that i don’t create unnecessary objects: I expected that useRef would work the same way, but the below returns a function instead of calling it once to intialize, then returning the prev created object after that. I suppose one could do something like this, but seems a lot less clean. Am I

Im trying to add an onClick function on the button so if the user clicks Yes, it removes the two buttons then add two new inputs field react js

this is the first code with the buttons elements while this is where the button component is called and rendered, i think this is where the logic will happen export default RightBody; again what I want to do is that onClick of the yes button, I want to display two input fields instead of the two buttons originally there. Theres

Array of components doesn’t update when props change

Codesandbox link I have two components, a Parent and a Child. The Parent components keeps a list of Children in state and renders it using the map method. The parent: The Child: Clicking the “add child” button adds an child to the children array. Clicking the “increment” button updates the counter on the parent, but the counter in the children

Advertisement