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

README example code is not working #36

Open
Chefty opened this issue Mar 16, 2021 · 0 comments
Open

README example code is not working #36

Chefty opened this issue Mar 16, 2021 · 0 comments

Comments

@Chefty
Copy link

Chefty commented Mar 16, 2021

The current example code at the end of the readme is not working, I guess because of the extra : null}.
Anyway, I think the whole code is deprecated with the latest react native version.

This code worked for me:

import * as React from 'react';
import { Button, View, } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import UnityView from '@asmadsen/react-native-unity-view';

const Stack = createStackNavigator();

function HomeScreen({ navigation }) {
  return (
    <View>
      <UnityView style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, }} />
    </View>
  );
}

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName="Home" screenOptions={{headerShown: false}}>
        <Stack.Screen name="HomeScreen" component={HomeScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

export default App;
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

1 participant