ist der richtige Weg zu definieren Propentypen für den Fluss in reagieren-native? Ich suche nach Richtlinien.Verwendung von nativen Requisite Typ mit Fluss
// @flow
import React from 'react';
import { TouchableOpacity, Image, StyleSheet } from 'react-native';
type Props = {
style?: StyleSheet.Styles,
onPress:() => mixed,
source: Image.propTypes.source
};
const IconButton = (props: Props) => (
<TouchableOpacity onPress={props.onPress}>
<Image style={props.style} source={props.source} />
</TouchableOpacity>
);
IconButton.defaultProps = {
style: {}
};
Export Standard IconButton;
Wie verwende ich es so als Beispiel ist:
<IconButton
onPress={()=>{}}
style={this.props.style}
source={require('./assets/images/circle.png')}
/>