Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

491
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda