Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React error #149 whenever using Animated (webpack production build only) #684

Closed
udfalkso opened this issue Oct 14, 2017 · 4 comments
Closed

Comments

@udfalkso
Copy link

I'm upgrading to the latest react-native-web (0.1.9) and react 16 and I'm seeing this error in production (not in development):

Error: Minified React error #149;

Element ref was specified as a string (node) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).

I've managed to reduce my app to a simple case that reproduces the issue. Using Animated.View causes this error. Using View doesn't.

BREAKS

import React from "react"
import { View, Animated } from "react-native"

export default class App extends React.Component {
  render() {
    return (
      <Animated.View style={{backgroundColor: 'red', width: 100, height: 100}} />
    )
  }
}

WORKS

import React from "react"
import { View, Animated } from "react-native"

export default class App extends React.Component {
  render() {
    return (
      <View style={{backgroundColor: 'red', width: 100, height: 100}} />
    )
  }
}

I've attached my package.json and webpack configs in a zip file.

Any ideas greatly appreciated! Thanks

configuration.zip

@necolas
Copy link
Owner

necolas commented Oct 16, 2017

Hi. Please could you put your config in a gist so I don't have to download and extract a zip (security)?

@necolas
Copy link
Owner

necolas commented Dec 2, 2017

Closing as if there is an issue it should be resolved after #716 is complete

@necolas necolas closed this as completed Dec 2, 2017
@necolas
Copy link
Owner

necolas commented Dec 5, 2017

This seems to be caused by the use of a string ref in the upstream package's implementation of createAnimatedComponent. Changing it to a callback ref resolved the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants