Я хочу создать повторно используемый компонент кнопки, но у меня возникли некоторые проблемы. Я вернусь undefined is not an onject evaluting '_nativebase.stylrsheetcreate'
. Я пытался уничтожить onPress и название, но не повезло. Может кто-нибудь дать четкое объяснение, как решить эту проблему? спасибо
import React from 'react';
import { View, Text, Button, StyleSheet } from 'native-base';
export const StyledButton = props => {
return (
<View style={styles.button}>
<Button
block
full
bordered
light
onPress={this.props.onPress}
>
<Text
style={{
color: '#FFFFFF',
}}
>
{this.props.title}
</Text>
{this.props.children}
</Button>
</View>
);
};
const styles = StyleSheet.create({
button: {
flex: 1,
padding: 10,
}
});
для визуализации
<StyledButton
title='Cancel'
onPress={this.somefunction}
/>