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

409
Views
Instrucción de bloque inesperada que rodea el cuerpo de la flecha; mueve el valor devuelto inmediatamente después del estilo de cuerpo de flecha `=>`
const loadUsers = () => { return function (dispatch) { axios .get(`${process.env.REACT_APP_API}`) .then((resp) => { console.log(resp); dispatch(getUsers(resp.data)); }) .catch((error) => console.log(error)); }; };

Recibo este error en el código anterior.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Si el bloque de una función de flecha solo tiene una instrucción de retorno, puede omitir el bloque y la palabra clave de return . De acuerdo con el linter que está utilizando, debe hacer eso:

 const loadUsers = () => function (dispatch) { axios .get(`${process.env.REACT_APP_API}`) .then((resp) => { console.log(resp); dispatch(getUsers(resp.data)); }) .catch((error) => console.log(error)); };
about 4 years ago · Santiago Trujillo 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!