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

242
Vistas
Object iteration in react component render is not working

First, I would like to inform you that am very new to react development. When I tried to render a tab with iteration I got the below error. Can someone kindly help me to identify why this not working. Is there mistake in syntax
#Implementation

  Line 76:  Expected to return a value in function                                 array-callback-return
  Line 77:  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  render() {
    const { classes,orderTabDataCollections } = this.props;
    const { value } = this.state;

    return (
      <div className={classes.root}>
        <AppBar position="static" color="default">
          <Tabs
            value={value}
            onChange={this.handleChange}
            indicatorColor="primary"
            textColor="primary"
            variant="scrollable"
            scrollButtons="auto"
          >

            {Object.keys(orderTabDataCollections).map(keyz =>
            <Tab key={keyz} label={keyz.toUpperCase()} />
   
    )}
            
          </Tabs>
        </AppBar>
        {
        Object.keys(this.props.orderTabDataCollections).map(function(keyz, index) {
        value === index && <TabContainer key={keyz} >
          <TweakDataForm key={keyz} tweakDataCollection={orderTabDataCollections[keyz]}/></TabContainer>  })}      
      </div>
    );
  }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

 ....
  {
    Object.keys(this.props.orderTabDataCollections).map(function(keyz, index) {
     if(value === index){
        return <TabContainer key={keyz} >
                 <TweakDataForm key={keyz} tweakDataCollection= 
                   {orderTabDataCollections[keyz]}/>
              </TabContainer> 
        }
       return null;
   })}    

map should return some value from its callback if callback function is passed. Updating the code for map wrapping TabContainer like above should fix Line 76: Expected to return a value in function error.

map

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