Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

490
Views
Button onClick not working in React x Laravel

Hello everyone i am quite lost right now, in my other react projects onClick is working just fine but now with my new app laravel with react i cannot do an Onclick this is crazy i dont know where the problem is because i have no error in the console...

EDIT

I finally found the problem, i imported twice a js file in my layout

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

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link rel="stylesheet" href="{{  asset('css/bootstrap.css')}}">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</head>
<body>
    @if (Auth::user())
        @include('inc.navbar') 
    @endif

        <main class="py-4">
            @yield('content')
        </main>

    <script type="text/javascript" src="js/app.js"></script>

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

can you try please to add to the button tag ( type="button" ) , if its not working try to remove the taskform component to check if there is error in the component

about 4 years ago · Juan Pablo Isaza Report

0

I also just faced this problem when using laravel 8 mix react 17, the solution is to downgrade to react 16.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!