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.

[0.56.0-rc.2] Animated.createAnimatedComponent causes undefined is not an object (_this_.setComponentref.bind)

See original GitHub issue

Description

Update to 0.56.0-rc.2 resulted in error shown below. I believe it is related to usage of Animated.Image or Animated.createAnimatedComponent that wraps something containing <Image />

UPDATE: Likely related to something being undefined here? https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/createAnimatedComponent.js#L39

simulator screen shot - iphone 7 - 2018-06-18 at 07 41 15

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 149.57 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.4.0 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.1.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.3.2 => 16.3.2 
      react-native: 0.56.0-rc.2 => 0.56.0-rc.2 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Reproducible Demo

Initiate new native project

react-native init --version 0.56.0-rc.2 TestApp

Use any Animated.Image component inside App.js for example:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Animated} from 'react-native';

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Animated.Image />
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <Text style={styles.instructions}>To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
alessandro-bottamedicommented, Jul 9, 2018

my .bablerc file:

{
  "presets": [
    "react-native"
  ],
  "plugins": [
    ["@babel/plugin-proposal-decorators", { "legacy": true }],
    ["@babel/plugin-transform-runtime", {
      "helpers": true,
      "polyfill": false,
      "regenerator": false
    }]
  ]
}

all working in RN 0.56.0 & Mobx 5.0.3

3reactions
0xAsimetriqcommented, Jun 21, 2018

@kelset sure thing, just made this repo, ran in my ios sim and got the issue

https://github.com/IljaDaderko/react-native--19763

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native - 'undefined is not an object'? - Stack Overflow
setState is not a function" trying to animate background color? Im just trying to loop fade the background color of a view in...
Read more >
Animated - React Native
Value can bind to style properties or other props, and can be interpolated as well. A single Animated.Value can drive any number of...
Read more >
typeerror: undefined is not an object (evaluating '_reactnative ...
I solved this by,. Commenting itemTextStyle: Text.propTypes.style in ..\node_modules\react-native-material-dropdown\src\components\dropdown file.
Read more >
useAnimatedProps | React Native Reanimated
This hook is a counterpart of useAnimatedStyle hook, but works for a non-style view properties. It allows for defining a set of native...
Read more >
Issue with Animated.multiplay: undefined is not an object ...
Hi everybody, I'm trying to make a custom floating scrollbar following this tutorial…
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