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.

Style doesn't work for Reanimated View when in a 2nd level nesting

See original GitHub issue

Description

Passing nested style in an array doesn’t work. When it’s a 2 level nesting

Screenshots

Steps To Reproduce

See code snippet.

Expected behavior

Nesting a style (animated style for that matter) should work when nested in a 2nd level array.

Actual behavior

Style doesn’t take any effect and being ignored.

Snack or minimal code example

const animatedStyle = ...;

// Doesn't Work (2 level nesting)
<Reanimated.View style={[{backgroundColor: 'red'},[animatedStyle]]} />

// Works (1 level nesting)
<Reanimated.View style={[{backgroundColor: 'red'}, animatedStyle]} />

Package versions

react-native-reanimated@2.0.0-alpha.5 react-native@0.62.2 react@16.11.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ethansharcommented, Apr 18, 2021

Hi, Is there any update on this issue?

0reactions
robertwt7commented, Dec 20, 2021

hello peeps, i think this is related to #2768 , i’m still experiencing this issue in nested Animated.View within Animated.ScrollView

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animations | React Native Reanimated - Software Mansion
Animations are first-class citizens in Reanimated 2. ... from the place where we make Shared Value amends to the place where we define...
Read more >
How to use Reanimated 2 (a beginners guide)
In this guide we'll learn what the core building blocks of Reanimated 2 are and how ot use them.
Read more >
Animations - React Native
The first level is an array to allow mapping across multiple args, and that array contains nested objects. For example, when working with ......
Read more >
React Native Animations: a Guide on Creating ... - UpsilonIT
Animations are a big part of the application interface today. Learn how to make animations in React Native using Reanimated 2 in this...
Read more >
react-native-reanimated - npm
We don't want to run "side effects" more often than necessary as it ... and the goal of react-native-reanimated is to provide lower...
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