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 property 'backgroundColor' is not supported by native animated module, when navigating back from browser.

See original GitHub issue

Current behaviour

I am using the card component to display news in my app. On click, I use the react-native’s inbuilt Linking to open a browser to display the article. Everything works fine till here. But when I click navigate back to the app using the back navigation button on iOS the app crashes with the below error.

Expected behaviour

I don’t expect any errors on navigating back to the app.

Code sample

JSX

<Section header={'News'}>
  {loading ? (
    <ActivityIndicator />
  ) : news.length < 1 ? (
    <Text>No News</Text>
  ) : (
    news.slice(0, 5).map((item) => {
      const date = new Date(item.publishedAt);
      return (
        <Card
          style={{marginVertical: 10}}
          key={`${item.url}`}
          onPress={() => handlePress(item.url)}>
          {/* <Surface> */}
          <Card.Title
            style={{padding: 10}}
            title={item.title}
            titleNumberOfLines={3}
            subtitle={moment(date).format('DD MMMM YY')}
            // left={LeftContent}
          />
          <Card.Content style={{padding: 10}}>
            <Paragraph>{item.description}</Paragraph>
          </Card.Content>
          <Card.Cover source={{uri: item.urlToImage}} />
          {/* </Surface> */}
        </Card>
      );
    })
  )}
</Section>

Function to open article

const handlePress = useCallback(async (url) => { // Checking if the link is supported for links with custom URL scheme. const supported = await Linking.canOpenURL(url);

if (supported) {
  // Opening the link with some app, if the URL scheme is "http" the web link should be opened
  // by some browser in the mobile
  await Linking.openURL(url);
} else {
  Alert.alert(`Don't know how to open this URL: ${url}`);
}

}, []);

Screenshots (if applicable)

image

What have you tried

Your Environment

software version
ios or android iOS
react-native 0.63.4
react-native-paper ^4.7.1
node v15.3.0
npm or yarn yarn
expo sdk

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
girish54321commented, Mar 11, 2021

Hi All after removeing onPress form <Card /> fixed the theme problem so now I am using TouchableOpacity for onPress action.

1reaction
codeyogi911commented, Mar 10, 2021

@girish54321 try this article. It solved my problem. Theming with React navigation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Style property 'width' is not supported by native animated ...
When adding it and setting it to 'yes', I got an error saying that " style property 'width' is not supported by native...
Read more >
React-native Animation.event style property is not supported ...
This error comes from validateTransform function inside React Native lib.You can check the TRANSFORM_WHITELIST in NativeAnimatedHelper for the property ...
Read more >
Animations - React Native
The opacity property on the View is mapped to this animated value. Behind the scenes, the numeric value is extracted and used to...
Read more >
animation - CSS: Cascading Style Sheets - MDN Web Docs
The animation shorthand CSS property applies an animation between styles. ... Determines whether the animation is playing or not.
Read more >
Introduction to Angular animations
The W3C maintains a list of animatable properties on its CSS Transitions page. About this guidelink. This guide covers the basic Angular animation...
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