0

I'm using Laravel 5.6, bootstrap 3.3.7 and recently added some react components with react native.

The thing is I have a dropdown that is included with bootstrap and everything is working just fine.

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">{{__('nav.categorias')}} <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li>
                            <a class="page-scroll" href="/a/route">a name</a>
                        </li>
                        <li>
                            <a class="page-scroll" href="/c/route">c name</a>
                        </li>
                        <li>
                            <a class="page-scroll" href="/b/route">b name</a>
                        </li>
                    </ul>
                </li>

    <!-- jQuery -->
    <script src="{{asset('js/jquery.js')}}"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="{{asset('js/bootstrap.js')}}"></script>

When i click in the dropdown the options are getting diplayed correctly.

But when I add (as laravel react said)

<script src="{{asset('js/app.js')}}"></script>

The dropdown is not working any more.

I saw in the source-page that the bootstrap and jquery files are beeing added and the source code is just fine.

Should I migrate my bootstrap native to react bootstrap dropdown native?

Any ideas?

1
  • You said you're using Laravel but then said you added some react native. This doesn't make sense. Laravle and React Native don't go hand in hand. Commented Feb 12, 2020 at 22:40

1 Answer 1

1

Are you using both app.js and bootstrap.js, jquery.js? If so, try removing bootstrap.js and jquery.js. Otherwise you're running the same code twice which may cause problems.

Sign up to request clarification or add additional context in comments.

6 Comments

Oh! That works but now I'm loosing another features from bootstrap LOL. At least I have a partial solution.
What features are you losing? Bootstrap in app.js should be the same as normal Bootstrap.
The nav is not holding the background color on scrolling down.
do you have any other idea why is this happening?
I wouldn't know, maybe a version diffrence?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.