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

237
Views
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 answers
Answer question

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 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!