Skip to content

On android useAnimatedStyle fails when Animated.FlatList has the onRefresh property. #4730

Open
@LhZzZz

Description

Description

const opacityStyle = useAnimatedStyle(() => {
    console.warn('inited', inited.value);
    return {
      opacity: inited.value ? 1 : 0,
    };
  });

<Animated.FlatList
    onRefresh={props.onRefresh}
    refreshing={props.refreshing}
    data={props.data}
    renderItem={props.renderItem}
    style={[{flex: 1}, opacityStyle]}
/>

the opacityStyle not working but if i remove onRefresh it works again. it only happens on android.

Steps to reproduce

  1. set onRefresh and animated style for a Animated.FlatList
  2. animated style not working
  3. remove onRefresh
  4. animated style works

Snack or a link to a repository

https://gitlab.com/dogofe/enhance-tab-view.git

Reanimated version

2.17.0

React Native version

0.71.2

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

Android emulator

Device model

No response

Acknowledgements

Yes

Metadata

Assignees

Labels

Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is providedReproducible 🎉

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions