Сообщение об ошибке типа prop для ключа prop.style `0` на карточке с использованием элементов React - PullRequest
0 голосов
/ 08 мая 2020

Я создаю карту, используя элементы react-native. это мой код

return (
    <Fragment>
        <Card
            title='HELLO WORLD'
            image={require('../../Assets/healthy.jpeg')}>
            <Text style={{marginBottom: 10}}>
                The idea with React Native Elements is more about component structure than actual design.
            </Text>
        </Card>
    </Fragment>
);

};

но я получаю это сообщение

Предупреждение: Неудачный тип пропса: Неверный ключ props.style 0 передан на Image. │ Плохой объект: {│ "0": {│ "width": null, │ "height": 150 │}, │ "position": "absolute", │ "left": 0, │ "right": 0, │ «верх»: 0, │ «низ»: 0 │} │ Допустимые ключи: [│ «дисплей», │ «ширина», │ «высота», │ «начало», │ «конец», │ «верх», │ "left", │ "right", │ "bottom", │ "minWidth", │ "maxWidth", │ "minHeight", │ "maxHeight", │ "margin", │ "marginVertical", │ "marginHorizontal", │ «marginTop», │ «marginBottom», │ «marginLeft», │ «marginRight», │ «marginStart», │ «marginEnd», │ «отступы», │ «paddingVertical», │ «paddingHorizontal», │ «paddingTop», │ «paddingBottom», │ «paddingLeft», │ «paddingRight», │ «paddingStart», │ «paddingEnd», │ «borderWidth», │ «borderTopWidth», │ «borderStartWidth», │ «borderEndWidth», │ «borderRightWidth», │ «borderBottomWidth», │ «borderLeftWidth», │ «позиция», │ «flexDirection», │ «flexWrap», │ «justifyContent», │ «alignItems», │ «alignSelf», │ «alignContent», │ «flex», │ «flexGrow», │ «flexShrink», │ «flexBasis», │ «ratio», │ «zIndex», │ «направление», │ «тень» Color », │« shadowOffset », │« shadowOpacity », │« shadowRadius », │« transform », │« transformMatrix », │« разложенная матрица », │« scaleX », │« scaleY », │« вращение », │» translateX ", │" translateY ", │" resizeMode ", │" backfaceVisibility ", │" backgroundColor ", │" borderColor ", │" borderRadius ", │" overflow ", │" tintColor ", │" opacity ", │ "overlayColor", │ "borderTopLeftRadius", │ "borderTopRightRadius", │ "borderBottomLeftRadius", │ "borderBottomRightRadius" │] │ в изображении (в Image. js: 62) │ в Image (at withTheme. * 1012) 40) │ в ThemedComponent (в withTheme. js: 57) │ в ForwardRef (Themed.Image) (в Card. js: 78) │ в RCTView (в Card. js: 77) │ в RCTView ( в Card. js: 42) │ в RCTView (в Card. js: 34) │ в Card (в withTheme. js: 42) │ в Themed.Card (в ConfirmedCardComponent. js: 27) │ в ConfirmedCardComponent (в приложении js: 24) │ в RCTView (в ScrollView. js: 1063) │ в RCTScrollView (в ScrollView. js: 1196) │ в ScrollView (в приложении js: 23) │ в RCTView (в SafeAreaView. js: 41) │ в ForwardRef (SafeAreaView) (в приложении js: 22) │ в ThemeProvider (в приложении. js: 20) │ в приложении (в renderApplication . js: 45) │ в RCTView (в AppContainer. js: 109) │ в RCTView (в AppContainer. js: 135) └ в AppContainer (в renderApplication. js: 39)

1 Ответ

0 голосов
/ 08 мая 2020

попробуйте это:

import HealthyImage from '../../Assets/healthy.jpeg';

return (
    <Fragment>
        <Card
            title='HELLO WORLD'
            image={HealthyImage}>
            <Text style={{marginBottom: 10}}>
                The idea with React Native Elements is more about component structure than actual design.
            </Text>
        </Card>
    </Fragment>
);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...