第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

React Native:失敗的道具類型:道具 businessPhoneNumberChanged

React Native:失敗的道具類型:道具 businessPhoneNumberChanged

森林海 2021-06-01 10:57:51
我有一個 React Native 應用程序,成員可以在其中更改他們的公司電話號碼,但是一旦用戶保存并關閉該屏幕,該電話號碼更改就不會持續(xù)存在。有一個警告說:失敗的道具類型:道具 businessPhoneNumberChanged 在 BusinessDetailsForm 中被標記為必需,但其值未定義。我想知道這是否與BusinessDetailsForm作為功能組件的事實有關,這意味著必須有一個父組件將 props 傳遞給它,而且我沒有在任何地方找到它的父組件:這是功能組件:import React from 'react';import {View, Text, ScrollView, TouchableOpacity} from 'react-native';import Icon from 'react-native-vector-icons/MaterialIcons';import {v2Colors, v2Fonts, v2ButtonStyles} from 'theme';import {Divider, Input, CheckBox} from 'common-components';import {TextButton} from 'react-native-material-buttons';import PropTypes from 'prop-types';import {ScaledSheet} from 'react-native-size-matters';const propTypes = {  businessName: PropTypes.string.isRequired,  businessNameChanged: PropTypes.func.isRequired,  businessPhoneNumber: PropTypes.string,  businessPhoneNumberChanged: PropTypes.func.isRequired,  businessWebsite: PropTypes.string.isRequired,  businessWebsiteChanged: PropTypes.func.isRequired,  changeBussinessAddressNavigation: PropTypes.func.isRequired,  changeMailingAddressNavigation: PropTypes.func.isRequired,  errors: PropTypes.object,  joinDate: PropTypes.string,  renewDate: PropTypes.string,  saveChanges: PropTypes.func.isRequired,  shortBusinessAddress: PropTypes.object.isRequired,  shortMailingAddress: PropTypes.object,  toggleSameAddresses: PropTypes.func,  useSameAddress: PropTypes.bool,};const BusinessDetailsForm = props => (  <View style={styles.container}>    <ScrollView contentContainerStyle={{paddingBottom: 56}}>      <View style={styles.titleContainer}>        <Text style={styles.title}>{'Business Information'}</Text>      </View>      <View style={styles.inputContainer}>        <View style={styles.icon}>我沒有看到 this 的父組件businessPhoneNumberChanged。當我使用 props 時,我會將其設為BusinessDetailsForm基于類的組件,但我不確定這是否是問題所在。我總是假設人們知道他們在做什么。道具類型的作用對我來說也不是 100% 清楚,因為我沒有使用它太多。所以拋開我自己的理論,為什么businessPhoneNumberChangedundefined的價值?
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 192 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號