Exception thrown while executing UI block: Attempted to remove non-existent subview
See original GitHub issue
Description
I am using react-native-shimmer. when I update react-native@0.66.1
and react-native-reanimated@2.3.0-alpha.3
then I am receiving the below error
Exception thrown while executing UI block: Attempted to remove non-existent subview
at
because it has conflict with react-native-shimmer
Expected behavior
Should not throw the error.
Actual behavior & Steps To Reproduce
Repro: https://github.com/nomi9995/ReproNonExistentsubview Throws an error but still works if I just close it.
just installed Package versions
which I added below.
then below code will reproduce this error
import React, {useState} from 'react';
import {SafeAreaView, StyleSheet, Text, View, Button} from 'react-native';
import Shimmer from 'react-native-shimmer';
const App = () => {
const [isVisible, setIsVisible] = useState<boolean>(true);
return (
<SafeAreaView style={styles.container}>
{isVisible && (
<Shimmer>
<Text>Loading...</Text>
</Shimmer>
)}
<Button
onPress={() => setIsVisible(!isVisible)}
title={isVisible ? 'Hide' : 'Visible'}
/>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
export default App;
Package versions
- React Native: ^v0.66.1
- React Native Reanimated: ^2.3.0-alpha.3
- react-native-shimmer: ^0.6.0
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
React Native: Exception thrown while executing UI block
So, to clarify, make sure any values you pass into a component using an Animated.Value is not undefined. The specific code I found...
Read more >UIKit | Apple Developer Forums
I am trying to restrict screenshot from my running iOS application. I have found following workaround: private extension UIView { func ...
Read more >React Native: Exception thrown while executing UI block
As @Peuchele commented, I was getting this same error, and the reason it was happening was because I passed a value into an...
Read more >ViewGroup - Android Developers
If you are implementing XML layout attributes as shown in the example, ... Called by a ViewGroup subclass to remove child views from...
Read more >react-native-macos - UNPKG
768, * Remove subviews from their parent with an animation. ... 1222, RCTLogError(@"Exception thrown while executing UI block: %@", exception);.
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 need to wait for a reply from the Shimmer maintainter. If you need a hotfix you can use a package patch with one of my PR.
I prepared PR to fix it by Shimmer side - https://github.com/oblador/react-native-shimmer/pull/33