Skip to content

Instantly share code, notes, and snippets.

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