import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import { store, persistor } from "./(redux)/store";
import { SafeAreaView } from "react-native-safe-area-context";
import { Redirect, Slot, SplashScreen, useRouter } from "expo-router";
import Toast, { BaseToast } from "react-native-toast-message";
import Header from "../components/Header";
import { View } from "react-native";
SplashScreen.preventAutoHideAsync();
export default function Layout() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<SafeAreaView>
<Header />
<Slot />
<Toast topOffset={150} config={toastConfig} visibilityTime={1000} />
</SafeAreaView>
</PersistGate>
</Provider>
);
}
const toastConfig = {
/*
Overwrite 'success' type,
by modifying the existing `BaseToast` component
*/
success: (props) => (
<BaseToast
{...props}
style={{ borderLeftColor: "#4BB543" }}
contentContainerStyle={{ paddingHorizontal: 15 }}
text1Style={{
fontSize: 15,
fontWeight: "400",
}}
/>
),
};
I have this code using Expo, but the problem seems to be the Slot component, because if i try to console.log something in it, it doesn’t show anything.
I tried to console.log something in it, it doesn’t show anything.
New contributor
user26194556 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.