Skip to content

Commit

Permalink
react app is wrapped with AuthContext
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdusshakur committed Sep 7, 2024
1 parent fb05d4b commit 3345ca4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resources/js/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { createRoot } from 'react-dom/client'
import { createInertiaApp } from '@inertiajs/inertia-react'
import { Inertia } from "@inertiajs/inertia";
import { Link } from "@inertiajs/inertia-react";
import { AuthProvider } from './AuthContext';

import axiosInstance from './axios';


window.Inertia = Inertia;
window.Link = Link;
window.$ = $;
Expand All @@ -24,6 +26,9 @@ createInertiaApp({
return pages[`./Pages/${name}.jsx`]
},
setup({ el, App, props }) {
createRoot(el).render(<App {...props} />)
createRoot(el).render(
<AuthProvider>
<App {...props} />
</AuthProvider>)
},
})

0 comments on commit 3345ca4

Please sign in to comment.