react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

Does not accepts Functional Components

Open Uttu316 opened this issue 5 years ago • 2 comments

The createAnimatableComponent does not accept Functional components. It is asking to change the functional component to class component. Solove this Issue.

Uttu316 avatar Mar 22 '20 03:03 Uttu316

Following the guide here: https://dev-yakuza.github.io/en/react-native/react-native-animatable/

get the same Invariant Violation: createAnimatedComponent does not support stateless functional components; use a class component instead.

gunnx avatar Apr 29 '20 06:04 gunnx

maybe you can use createAnimatableComponent to the used components first (?)

const SomeComponent = (props) => {
.
.
.
  const AnimatedView = createAnimatableComponent(View);

  const renderWelcomeText = () => (
    <AnimatedView animation="fadeIn">
        <Text style={styles.welcomeText}>Welcome!</Text>
        <Text style={styles.usernameText}>{username}</Text>
    </AnimatedView>
  );
.
.
.
}

export default SomeComponent;

Lzadhito avatar Oct 29 '20 13:10 Lzadhito