import { StyleSheet, TextStyle, ViewStyle, ImageStyle } from 'react-native';
export const styles = StyleSheet.create({
spacing: (marginBottom: number) => {
return {
marginBottom,
}
}
});
The error returned was:
Type '(marginBottom: number) => { marginBottom: number; }' is not assignable to type 'ViewStyle | TextStyle | ImageStyle'.ts(2322)
The code even works, but returns the mentioned error. Usage is supposed to be like this:
<View style={styles.spacing(50)}>
<Button title={'Login'} onPress={handleSign} />
</View>