Questions tagged [react-lifecycle]
313 questions
1
vote
1 answer
How do I implement PayPal in React with different payment options?
I'm trying to grasp how to setup a PayPal method within React properly.
I've got three cards with each a different payment amount and cannot figure out how to pass props from my Class to the PayPal Function.
All i need is the Cost and Description to…

PotatoFries
- 49
- 7
1
vote
0 answers
Jotai + React: unexpected re-rendering, and unexpected stale state value
I'm making a game that, like most games, has various scenarios that can be triggered from anywhere else in the game.
I opted to use Jotai as I found it very easy to use as a global state management tool. Jotai atoms behave a bit like setState and…

Angus Ryer
- 114
- 2
- 10
1
vote
1 answer
componentWillUnmount method not called when react Component disapears
I have a problem understanding why in some cases componentWillUnmount method is not called even if the component I would expect is unmounted.
To be more concrete, this is the example. Let's consider a Parent component with a button and 2 children:…

Picci
- 16,775
- 13
- 70
- 113
1
vote
2 answers
Displaying fetched data issue : objects not valid as React child / TypeError : undefined
I would like to display data fetched from an api, by using lifecycle methods.
I manage to fetch the data (object) and to populate my data in the state (array). But I can't display the values in the return part.
The first part of the code that seems…

Mamily
- 45
- 6
1
vote
0 answers
React useReducer hook and functional component lifecycle guarantees
I'd like to confirm an assumption I am making about functional components and useReducer. From my understanding useState is useReducer under the covers so I'll use useState in this example to simplify.
function Example(){
const [count, setCount] =…

nathanwinder
- 87
- 6
1
vote
1 answer
Why my callback is calling multiple time with redux
I am writing a react application with redux, with avoiding the react-redux, which is technically possible if we manually handle all the dispatched events. Here is the sample code.
The index.html