pushNative
or any other native controller call. I checked the native code and it's look like you have to register the controllers that you want to present/push from react native but I'm not really sure. Is anyone try this or know how is suppose to work?
// index.ios.tsx
import Home from './home'
import Login from './login'
import Navigator from 'native-navigation'
Navigator.registerScreen('demo', () => Login)
Navigator.registerScreen('Home', () => Home)
// login.tsx
import * as React from 'react'
import Navigator from 'native-navigation'
import {
Alert,
AppRegistry,
Button,
Text,
View
} from 'react-native'
import { styles } from './styles'
export interface Props {}
export interface State {}
export default class LoginScreen extends React.Component<Props, State> {
render() {
const onPressFunction = () => {
console.log('clicked')
Navigator.present('Home')
}
return (
<View style={styles.container}>
<View>
<Text style={styles.welcome}>
Welcome to React Native! (in TypeScript)
</Text>
<Text style={styles.instructions}>Please Login Below</Text>
<View style={styles.buttonContainer}>
<Button
onPress={onPressFunction}
color="black"
title="Login"
accessibilityLabel="Login"
/>
</View>
</View>
</View>
)
}
}
airbnb/native-navigation
looks exactly the direction I want to head to, but what I noticed was, that the repository has its last changes a year ago and it's also marked as beta
. Is there still a progress? Or did the progress stopped for this project and the overall recommendation is using wix/react-native-navigation
?