Is there a way to add Provider to root node with new routing system ? #46
Answered
by
bndkt
Dhananjay-JSR
asked this question in
Q&A
-
is it possible to edit entry module and add something like this ? |
Beta Was this translation helpful? Give feedback.
Answered by
bndkt
Oct 2, 2022
Replies: 2 comments
-
You would use a layout route for this, see https://expo.github.io/router/docs/features/layout-routes. Your (layout).tsx could then look like this: import { Children } from "expo-router";
import { Provider } from "../components/Provider";
export default function Layout() {
return (
<Provider>
<Children />
</Provider>
);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
EvanBacon
-
at the present date the names have changed, this is a example using react-native-toast-message // app/_layout.tsx
import { Slot } from 'expo-router';
import Toast from 'react-native-toast-message';
export default function RootLayout() {
return (
<>
<Slot />
<Toast />
</>
);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You would use a layout route for this, see https://expo.github.io/router/docs/features/layout-routes.
Your (layout).tsx could then look like this: