How to avoid flickering when Avatar re-render again and again.
See original GitHub issueExplain what you did
Expected behavior
not show to user that, avatar re-render again and again.
Describe the bug
To Reproduce
<Avatar
rounded
size={height/6}
defaultSource ={DummyUser}
source ={profileimageTutor ? {uri:profileimage} : DummyUser}
defaultSource ={profileimageTutor ? {uri:profileimage} : DummyUser}
icon={{name: 'user', type:'antdesign'}}
containerStyle={{borderWidth:3, borderColor:Colors.Grey89, elevation:2}}
resizeMethod="scale"
resizeMode="cover"
/>
Screenshots
Your Environment (please complete the following information):
| software | version | yarn install v1.16.0 | --------------------- | ------- | “react-native-elements”: “^1.2.7”, “react”: “16.9.0”, “react-native”: “0.59.9”,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:34
Top Results From Across the Web
Avoid flickering images when state change? : r/reactjs - Reddit
My component maps it and returns a message component for each message (this component has an avatar image and the message content).
Read more >React Re-Render Causes Flickering : How can i fix this?
Re-render is fine tho however my images are flickering on mobile browser. ... to go into "Prop Drilling" again which is not a...
Read more >Fix the slow render before you fix the re-render - Kent C. Dodds
Stop punching yourself in the face every time you blink. Fix your slow renders first. Then deal with the "unnecessary re-renders" (if you...
Read more >zoom causing screen to flicker - Ramozzi & Friends
Press the Power button to start the computer and repeatedly press the F10 key to ... 2021-11-12 12:34 PM. screen flickering will stop...
Read more >Flickering / Flashing / Refreshing UI?
If I switch back to first opened window (or leave both windows open each in separate screen and just go over it with...
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 Free
Top 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



I can confirm that wrapping the component with React.memo solved the issue for me, since the component will be cached and not re-rendered unless the image changes.
If you have a functional component then you can export it like this:
This will only cause the component to re-render if any of the props have changed.
If you use class component then you can extend it from
PureComponentinstead ofComponent:PureComponentwill work likeReact.memo