我需要用 ThemeProvider 标记将我的应用程序主组件括起来,但我不知道在哪里将其括起来,因为我使用的是 react-navigation 中的 appContainer,看起来我需要将 appContainer 括起来。
我正在一个没有博览会的本地反应项目中工作。我正在导入 react-native-elements 和 react-navigation。我需要附上已经被 appContainer 包装的 app.js
应用程序.js
import { createSwitchNavigator, createStackNavigator, createAppContainer } from 'react-navigation';
import PantallaInicio from './components/home/PantallaInicio';
import PantallaLogin from './components/auth/PantallaLogin';
import PantallaRegistro from './components/auth/PantallaRegistro';
import PantallaCargando from './components/auth/PantallaCargando';
const AppStack = createStackNavigator({ Home: PantallaInicio, });
const AuthStack = createStackNavigator({ Login: PantallaLogin, Registro: PantallaRegistro });
export default createAppContainer(createSwitchNavigator(
{
AuthLoading: PantallaCargando,
App: AppStack,
Auth: AuthStack,
},
{
initialRouteName: 'AuthLoading',
}
));
index.js
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
抱歉,我还没有任何输出,谢谢您的时间。