React hooks crashes onLoadEnd
See original GitHub issueI’m using FastImage component from react-native-fast-image
with React useState in callback.
like this
const Avatar = (props) => {
const [isImageUploaded, setIsImageUploaded] = useState(false);
return (
<View style={sizeStyle}>
<FastImage
source={{ uri: profileImg }}
onLoadEnd={() => {
setIsImageUploaded(true);
}}
/>
</View>
);
};
Avatar
component used inside FlatList
and when I’m clearing its data I’m getting crash
Crash disappear without setIsImageUploaded(true);
like
<FastImage
source={{ uri: profileImg }}
onLoadEnd={() => {
// setIsImageUploaded(true);
}}
/>
I’m new to React hooks. Any ideas on how to correctly deal with such cases?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
react-native-fast-image with React hooks crashes onLoadEnd
I'm new to React hooks. Any ideas on how to correctly deal with such cases? reactjs · react-native · react-hooks.
Read more >[Solved]-React Native ListView dataSource allways null-React ...
Coding example for the question React Native ListView dataSource allways null-React Native. ... react-native-fast-image with React hooks crashes onLoadEnd ...
Read more >Hooks FAQ - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. This page...
Read more >Untitled
Bug Fixes. hippy-react: add overflow scroll to fix listview unable to scroll (96c670a) ... hippy-vue: add animaiton actionsDidUpdate hook (f61b48e) ...
Read more >RUM Now Offers React Native Crash Reporting and Error ...
Expedite debugging your React Native applications with readable error reports and built-in alerting.
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
Thank you! my crash was at setOnFastImageError, however, the same approach you made in the pull request worked there too.
@manithin you can use workaround from my pull request https://github.com/DylanVann/react-native-fast-image/pull/506