Closed
Description
Description
When prompted to start "transform.forEach is not a function".Log as shown below.
2017-06-21 10:43:59.220 [error][tid:com.facebook.React.JavaScript] transform.forEach is not a function. (In 'transform.forEach', 'transform.forEach' is undefined)
2017-06-21 10:43:59.224 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: transform.forEach is not a function. (In 'transform.forEach', 'transform.forEach' is undefined)
Reproduction Steps
react-native start
Sample Code
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
export default class HelloWorld extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</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,
},
});
AppRegistry.registerComponent('HelloWorld', () => HelloWorld);
Solution
The 119 line in the following file, transform, may be a variable of type bool
/node_modules/react-native/Libraries/StyleSheet/processTransform.js
Additional Information
- React Native version:"react": "16.0.0-alpha.12", "react-native": "0.45.1"
- Platform: iOS
- Development Operating System: macOS
- Build tools: Xcode