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

196
Vistas
In react native, calling a function in React

I am a newbee, I sorry all if my question is wrong

This is a code, I refer React tutorial:

<form onSubmit={() => handleSubmit(createUser)} className={classes.form}>

I wanna ask that:

  1. Why my they used a inline Arrow Function ?
  2. And what happen i cannot use to use it ?
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

1 Sub Question Answer:

Inline Arrow Function is created on render because the function definition is inside of the onClick handler, which is inside of the component render method (or return, in the case of functional React components).

You’d use an inline function to pass in additional arguments to a function, such as a value from a loop, or the target button’s value.

Let’s take a look at an example:

import React from 'react';

function App() {
  return (
    <button onClick={() => alert('hello'))}>
      Click me!
    </button>
  );
}

export default App;

2 Sub Question Answer: You can use to use it. You can take a look at different ways you can do the onClick Event Handling here

about 4 years ago · Juan Pablo Isaza Denunciar

0

The 'anonym/arrow-function' function is for pass the reference of the function, and that reference react will call when detect the event. Is like variable storage

If you cant use it, you can pass a reference of a normal function

const handleSubmit = (...args) =>  {}
<form onSubmit={handleSubmit} className={classes.form}>

the args will get all event parameters of anything that event handle

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