Skip to content

Conversation

ethanshar
Copy link
Collaborator

@ethanshar ethanshar commented Aug 11, 2020

WOAUILIB-1006
Today our TouchableOpacity's onPress callback support passing back the props the user pass.
This is very useful cause it helps avoid passing inline callback
So instead of doing this

<TouchableOpacity someValue={1}  onPress={(props) => doSomething(props.someValue)} />

You can do

<TouchableOpacity someValue={1}  onPress={doSomething} />
...
doSomething({someValue}) => {...}

After migrating to TS this pattern has become an issue, because when a user pass an arbitrary prop like someValue typescript throws an error.
The new customValue prop purpose is to have a dedicate prop for passing these values.

@ethanshar ethanshar merged commit 8401a91 into master Aug 11, 2020
@ethanshar ethanshar deleted the feat/Touchable_arbitraryValue branch September 21, 2020 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants