We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import React from 'react'; import PropTypes from 'prop-types'; import { AppRegistry, Button, NavigatorIOS, Text, View } from 'react-native';
export default class NavigatorIOSApp extends React.Component { render() { return ( <NavigatorIOS initialRoute={{ component: MyScene, title: 'My Initial Scene', }} style={{flex: 1}} /> ) } }
class MyScene extends React.Component { static propTypes = { title: PropTypes.string.isRequired, navigator: PropTypes.object.isRequired, }
constructor(props, context) { super(props, context); this._onForward = this._onForward.bind(this); }
_onForward() { this.props.navigator.push({ title: 'Scene ' + nextIndex, }); }
render() { return ( Current Scene: { this.props.title } ) } } AppRegistry.registerComponent('Demo', () => MyScene); [ react-native-cli: 2.0.1 react-native: 0.46.4 ]
The text was updated successfully, but these errors were encountered:
所以,为什么报错,我也遇到了,还是没有解决吗?
Sorry, something went wrong.
No branches or pull requests
import React from 'react';
import PropTypes from 'prop-types';
import { AppRegistry, Button, NavigatorIOS, Text, View } from 'react-native';
export default class NavigatorIOSApp extends React.Component {
render() {
return (
<NavigatorIOS
initialRoute={{
component: MyScene,
title: 'My Initial Scene',
}}
style={{flex: 1}}
/>
)
}
}
class MyScene extends React.Component {
static propTypes = {
title: PropTypes.string.isRequired,
navigator: PropTypes.object.isRequired,
}
constructor(props, context) {
super(props, context);
this._onForward = this._onForward.bind(this);
}
_onForward() {
this.props.navigator.push({
title: 'Scene ' + nextIndex,
});
}
render() {
return (
Current Scene: { this.props.title }
)
}
}
AppRegistry.registerComponent('Demo', () => MyScene);
[
react-native-cli: 2.0.1
react-native: 0.46.4
]
The text was updated successfully, but these errors were encountered: