[add] initial 'onLayout' support

Add initial support for 'onLayout' when components mount and update.

Ref #60
This commit is contained in:
Nicolas Gallagher
2016-07-10 22:15:51 -07:00
parent 5e1e0ec8e5
commit 597fcc65e8
17 changed files with 112 additions and 37 deletions
+2
View File
@@ -33,6 +33,7 @@ export default class App extends React.Component {
<Heading size='large'>Image</Heading>
<Image
onLayout={(e) => { console.log(e.nativeEvent.layout) }}
accessibilityLabel='accessible image'
children={<Text>Inner content</Text>}
defaultSource={{
@@ -57,6 +58,7 @@ export default class App extends React.Component {
<Heading size='large'>Text</Heading>
<Text
onPress={(e) => { console.log('Text.onPress', e) }}
onLayout={(e) => { console.log(e.nativeEvent.layout) }}
testID={'Example.text'}
>
PRESS ME.