question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I use this project inside FlatList's item?

See original GitHub issue

I write ItemList component and when select item, navigator will push to Detail component and show selected image in full size this is my code

ItemList

class ItemList extends Component {
  renderItem = ({ item, index }) => {
    return (
      <TouchableOpacity
        style={styles.cell}
        onPress={() => { this.props.navigation.navigate('DETAIL', { item, index }) }}
      >
          <Transition shared={`image_${index}`}>
            <Image
              style={styles.image}
              source={{ uri: item.uri }}
            />
          </Transition>
      </TouchableOpacity>
    )
  }

  render() {
    return (
      <View style={styles.container}>
        <FlatList
          data={itemData}
          renderItem={this.renderItem}
          keyExtractor={(_, index) => `${index}`}
          numColumns={3}
        />
      </View>
    )
  }
}

Detail

const Detail = (props) => (
  <View style={styles.container} >
    <Transition shared={`image_${props.navigation.state.params.index}`}>
      <Image
        style={styles.image}
        source={{ uri: props.navigation.state.params.item.uri }}
      />
    </Transition>
  </View>
)

screen shot 2561-04-16 at 10 48 51

but when I run my project, the animations works great but my image not appear after I provide it with Transition

out

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chrfalchcommented, Apr 17, 2018

I’m currently looking into this issue to see if I can find an easy fix.

1reaction
chrfalchcommented, Apr 18, 2018

Added fix in PR #10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display a List Using the FlatList Component in React Native
React Native provides a FlatList component to create a list. FlatList only renders the list items that can be displayed on the screen....
Read more >
React-Native nested Flatlist - Stack Overflow
You can implement SectionList from 'react-native' library instead of using an nested FlatList. Its easier and a better solution.
Read more >
How to use the FlatList Component — React Native Basics
First create a new function that renders the component you want in the header. You then want to actually render that header by...
Read more >
How to use the FlatList component in React - LogRocket Blog
This post shows you how to use the FlatList component to display lists of items in React Native apps, implement pull to refresh, ......
Read more >
Displaying a List in React Native: Map Method or FlatList ...
FlatList is a React Native component that only loads items that are currently visible on the screen and it deletes items as they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found