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

177
Views
Image is not being called proprely in a flatList

So, I am using a FlatList to render menuItems, but for some reason images are not rendering, it is displaying this error bundling failed: app\FileMenu.js: app\FileMenu.js:Invalid call at line 35: require(item.img). I dont know why is this happening, when the image is called properly, I could really use some help.

class FileMenu extends Overlay {
    constructor(props) {
        super(props, null, null)
        this.state = {visible: false, menuItems: [
            {   name:'Rename',
                img: './img/renameFile.png'
            },
            {
                 name: 'Move',
                 img: './img/moveFile.png'
            }         
        ]}
    }

    renderMenuItem({item, index}) {
        return <View style={styles.container}>
        <Text style={styles.items}>{item.name}</Text>
        <Image
           source={require(item.img)}
         style={{ width:'30%', height:'30%' }}
           >
           </Image>
        </View>
    }
    onBackdropPress() {
        this.setState({visible: false})

    }
    render() {
       return <Overlay style={styles.overlay} isVisible={this.state.visible}
                       onBackdropPress={this.onBackdropPress.bind(this)}>                     
                   <FlatList data={this.state.menuItems} 
                       renderItem={this.renderMenuItem.bind(this)} 
                       keyExtractor={(item, index) => `${index}`}>
                   </FlatList>
                 <TouchableOpacity
                 onPress={this.onBackdropPress.bind(this)}
                      style={styles.button}>                    
                      <Text>X</Text>
                </TouchableOpacity>
             </Overlay>
    }
}

export {FileMenu}
about 4 years ago · Juan Pablo Isaza
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!