Skip to content

v2.0.3: Warning: TypeError: Cannot read property 'displayName' of undefined. when using reanimated with CellRendererComponent #1884

@Nedi11

Description

@Nedi11

No issue in 2.0.0-alpha.10
Issue present on newer versions

Current behavior

Warning: TypeError: Cannot read property 'displayName' of undefined

This error is located at:

  180 |     const AnimatedCellContainer =
> 181 |       Animated.createAnimatedComponent(CellContainer);
  const CellRenderer = (props: any) => {
    const AnimatedCellContainer =
      Animated.createAnimatedComponent(CellContainer);
   
...

    return (
      <AnimatedCellContainer {...props} style={[props.style, animatedStyles]} />
    );
  };

Expected behavior

No warning/error

To Reproduce

Install v2.0.3
use cell renderer component with reanimated

 <FlashList
 CellRendererComponent={CellRenderer}
 disableAutoLayout={true}
.../>


  const CellRenderer = (props: any) => {

    const AnimatedCellContainer =
      Animated.createAnimatedComponent(CellContainer);
...

 return (
      <AnimatedCellContainer {...props} style={[props.style, animatedStyles]} />
    ); };

Platform:

  • iOS
  • Android

Environment

Issue present on v2.0.3 v2.0.2 v2.0.1 v2.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Edge case, has workaround, cosmetic, rarebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions