question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

https://github.com/software-mansion/react-native-reanimated/blob/ce76e66aaf47c26bb1ff818d72a50b55e092ca05/ios/LayoutReanimation/REAAnimationsManager.m#L101

because it has conflict with react-native-shimmer

RNShimmeringView.m#L28

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:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
piaskowykcommented, Nov 12, 2021

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.

1reaction
piaskowykcommented, Nov 12, 2021

I prepared PR to fix it by Shimmer side - https://github.com/oblador/react-native-shimmer/pull/33

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found