首页 > 解决方案 > 评估 _react-native 动画 Text.PropsTypes.style

问题描述

我是 React Native 的新手,我正在尝试使用 React Native Material 下拉菜单,但我面临一个问题

评估 _react-native 动画 Text.PropsTypes.style

import { Dropdown } from 'react-native-material-dropdown'
var rbdagegroup = [
  { label: 'Adult', value: 'A' },
  { label: 'Junior', value: 'J' }
];

    export default class PersonalInfo extends React.Component {
      constructor(props) {
        super(props)
      }
      state = {
        AgeGroup: '',
      }
      render() {

        return (
         <View style={{ flex: 1, marginTop: '10%' }}>
    <TextInput
        placeholder="plac  "
        />
                  <Dropdown
                    value={this.state.AgeGroup}
                    data={rbdagegroup}
                    placeholder='Please select USTA Rating'
                    pickerStyle={{ borderBottomColor: 'transparent', borderWidth: 0 }}
                    dropdownOffset={{ 'top': 0 }}
                    containerStyle={{ width: '100%', marginRight: '10%' }}
                    inputContainerStyle={{ borderBottomWidth: 0 , paddingTop:"1%"}}
                    onChangeText={(AgeGroup) => {
                      this._SetAgeGroup({
                        AgeGroup
                      })
                    }}
                  />

          </View>
      );

      }

    }

我该如何解决这个问题?

标签: react-native

解决方案


您可以通过在 ..\node_modules\react-native-material-dropdown\src\components\dropdown 文件中注释 itemTextStyle: Text.propTypes.style 来解决此问题。

并在 react-native-material-textfield 的 affix/index helper/index label/index 中删除 Animated.Text.propTypes.style 中的 Animated 并添加 import { Animated, Text} from 'react-native'; 在上述三个文件中的每一个中。


推荐阅读