Skip to content

Render prop method on View does not work for Images #1369

@Abhir16

Description

@Abhir16

The following throws an error: Error: TypeError: Cannot read property 'width' of undefined

<View fixed render={({ pageNumber }) => {
        // I added this 
    if (pageNumber === 1) {
      return <View style={{ height: 150, backgroundColor: 'blue' }}><Text>{pageNumber}</Text></View>
    }

    return <View style={{height: 50, width: 50}}><Image
		style={styles.image}
        src="/images/quijote1.jpg"
                   /></View>

Ref: repl

It starts working fine when Image is not used in the render prop. What is a work around for this?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions