Skip to content

Exception thrown while executing UI block: Attempted to remove non-existent subview #32

@numandev1

Description

@numandev1

software-mansion/react-native-reanimated#2554

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions