[BUG] - Value doesn't change when component parent is rendered
See original GitHub issueHi guys,
I have NumericInput component inside another one with the following structure:
Class Product {
this.state = {
quantity: 2;
}
render(){
return (<View>....</View>
<NumericInput
...
value={this.state.quantity}
onChange={...} />)
}
}
As the Produc is rendered, because of quantity state update, NumericInput doesn’t render itself. Inside the NumericInput I see the old quantity value.
I’d like the quantity value is rendered inside NumericInput component as well.
Enviorment (please complete the following information):
- Version: 1.8.3
- React Native version: 0.61
- Device: Android 7
Can I solve the bug? Any workaround?
Thanks in advance, Simone
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
React: Parent component re-renders all children, even those ...
Yes , by default if parent changes all its direct children are re-rendered but that re-render doesn't necessarily changes the actual DOM ...
Read more >Why React Child Components Don't Update on Prop Changes
In React, it's a common problem to have child components that don't re- render when you expect them to. In particular, a common...
Read more >Children don't re-render when parent component is optimised
I am seeing something that looks like a bug and have written a simple test case for it. Please refer to this WebpackBin...
Read more >Re-rendering Components in ReactJS - GeeksforGeeks
The code gives a message each time the component's render function is called. Each time the count button is clicked state change is...
Read more >React.Component
These methods are called when there is an error during rendering, in a lifecycle method, or in the constructor of any child component....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
Add this to the NumericInput component (NumericInput.js) and it will work just fine.
@simo385 how did you resolve it