Skip to content

Instantly share code, notes, and snippets.

@ltsharma
Last active June 13, 2020 09:30
Show Gist options
  • Save ltsharma/b22aa8c7507e144477c3eeba7d118685 to your computer and use it in GitHub Desktop.
Save ltsharma/b22aa8c7507e144477c3eeba7d118685 to your computer and use it in GitHub Desktop.
export default ()=>{
const [childState, setChildState] = useState(0);
//Moved functions
const awesomeChildListRenderItem = ({item})=>(<AwesomeChild {...item} onPress={(number)=>{setChildState(number)}} />)
const awesomeChildListKeyExtractor = (item)=>(`awesome-child-key-${item.id}`);
return(
<FlatList
renderItem={awesomeChildListRenderItem}
keyExtractor={awesomeChildListKeyExtractor}
/>)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment