#Need Help with Layouts using inertia and react

1 messages · Page 1 of 1 (latest)

random crescent
#

https://paste.laravel.io/617906a9-c826-47c0-aa9e-5376edb96203
this is my app.blade.php

in this if i add @inertia outside it working

    @inertia
    <div id="app">
        <div class="main-wrapper">
            <div class="navbar-bg height-75"></div>
            <nav class="navbar navbar-expand-lg main-navbar user-navbar">
                <div>```


but if i add like this here where it is supposed to be it is not working 
      ```      <!-- Main Content -->
            <div class="main-content main-sm-user main-user pl-md-5 pr-md-5">
                <section class="section mt-30">
                     @inertia
                    @yield('content')
                </section>
            </div>

i am seeing 17056:1 Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
at JSON.parse (<anonymous>)
at U (createInertiaApp.ts:79:36)
at app.jsx:12:1

i dont know if i am doing it in wrong way
my app layout is little bit complicated as i am a begginer .. ie ..admin can select theme based on that the app theme will change

simple beacon
#

Yes, because you have another div with the id app defined, which is what Inertia uses by default. So it'll try to mount on your div, instead of the one from Inertia containing all required data

simple beacon