React-native: TypeError: expected dynamic type double but had type string react native

Created on 4 Oct 2015  路  11Comments  路  Source: facebook/react-native

This issue seems like https://github.com/facebook/react-native/issues/2983 and https://github.com/facebook/react-native/issues/2855 however it's slightly different wording.

I've read both of those issues now and can't understand what the fix is. For instance, the fix says to move a folder called ReactAndroid into your project folder and adding it to settings.gradle. But where is this ReactAndroid folder? I don't see it.

I am on React Native 0.11.4 and can't simply use 0.12.0-rc (assuming that would fix it...) because upgrading to -rc breaks other libraries (I get errors like "Peer [email protected] wants react-native@>=0.8.0")

TypeError: expected dynamic type double but had type string react native

Locked

Most helpful comment

Wrap the element in a View and rotate this view, not element.

All 11 comments

Closing this. Let's reopen if this still happens.

Getting same error on Android with:

    "react": "16.0.0-alpha.6",
    "react-native": "^0.44.0"

The elements I have tied to my app are:

  StyleSheet,
  View,
  Text,
  PanResponder,
  Animated,
  Dimensions,
  ScrollView,
  TouchableOpacity,

Seems to be specific to TouchableOpacity. In my case its a nested one within another TouchableOpacity.

something like:

<TouchableOpacity ...>
   <TouchableOpacity ...>
</TouchableOpacity>

@julesmoretti @satya164

I'm actually getting this error as well, but its for an Animation. Working great on iOS.
image

@hzyIO - I am having same issue; works on iOS but giving error on Android. Let me know did you found any solution.

I have the same error. It happens when I rotate elements and then click on them. One element is the switcher of camera (react-native-camera), another one - go back arrow from react-navigation.

Also experiencing this issue, seems to be on this line:

    StaticTransformConfig transformConfig = new StaticTransformConfig();
    transformConfig.mProperty = property;
    transformConfig.mValue = transformConfigMap.getDouble("value");

When fetching a rotation value, it fails because the rotation value is a string (like '10deg') instead of a double.

Still thinking about a solution that doesn't involve changing react-native itself.

Wrap the element in a View and rotate this view, not element.

@natakina you are a god among men, it works perfectly.

@natakina yes all Right thank you for perfect answer

These sort of incoherent implementations is really annoying when you develop iOS firs then check on Android.

Was this page helpful?
0 / 5 - 0 ratings