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.

Unable to set shadowOffset through reanimated

See original GitHub issue
<Animated.View
  style={[
    styles.playBtn,
    {
      shadowOffset: {
        height: interpolate(progress, {
          inputRange: [0, 1],
          outputRange: [5, 10],
          extrapolate: Extrapolate.CLAMP,
        }),
        width: 0,
      },
    },
  ]}
/>

the results Screen Shot 2020-03-06 at 7 48 32 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jakub-gonetcommented, Aug 11, 2020

This is related to the wrong handling of nested styles internally.

Repro:

import React from 'react';

import Animated from 'react-native-reanimated';
Animated.addWhitelistedUIProps({shadowOffset: true});
const Example = () => {
  return (
    <Animated.View
      style={[
        {
          shadowOffset: {
            height: new Animated.Value(50),
            width: 20,
          },
        },
      ]}
    />
  );
};

export default Example;

PS. @nasmuris - if you use useRef like that: useRef(new Animated.Value(0)).current; it won’t give you much value, because it’s creating and disposing new Animated.Value per rerender. Check out useValue

0reactions
jakub-gonetcommented, Aug 11, 2020

Fixing this bug requires changing a lot of internal implementation (same problem as in transform node). We discussed it internally and decided to not fix this one - we’re focusing on getting v2 stable in where this problem don’t exist.

We’re open for small PRs though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reanimated 2 failed to create a worklet, maybe you forgot to ...
I have found this issue on this link. These are the steps that I have followed for having my project up and running...
Read more >
In Naruto, can someone who gets reanimated use the multi ...
Simply put, no. People who make shadow clones control how much chakra each one gets. However, splitting it evenly is an excellent way...
Read more >
Shadow Atrium | Don't Starve Wiki - Fandom
It is dropped by killing a level 3 Shadow Piece and its only purpose is to revive the Odd Skeleton to spawn a...
Read more >
Fixing Reanimate Shadow : r/Shadowverse - Reddit
The problem is the mechanism of the hidden graveyard. That fact that cards can get put in there (through Burial Rite) and taken...
Read more >
react-native-reanimated/plugin - You.com | The Search Engine You ...
When I import Animated in my file, no matter I use it somewhere or not, every time it says that Reanimated 2 failed...
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