【问题标题】:TypeError: undefined is not an object (evaluating '_reactNativeReanimated.EasingNode.linear')TypeError: undefined is not an object (评估'_reactNativeReanimated.EasingNode.linear')
【发布时间】:2021-09-03 16:22:46
【问题描述】:

当我使用“react-native-floating-label-input”时遇到什么问题:“^1.3.9” 如果您有任何使用“react-native-floating-label-input”的方法,请给我(附源代码)。 图片 My problem image

我的代码

import React, {useState} from 'react';
import { StyleSheet, TouchableOpacity, View, Image} from 'react-native';
import { useTranslation,  } from 'react-i18next'
import { useNavigation } from '@react-navigation/native';
import styles from './style'
import images from '../../theme/images';
import { colors } from 'react-native-elements';
import { FloatingLabelInput } from 'react-native-floating-label-input';
interface SignInScreenProps {

}

const SignInScreen: React.FC<SignInScreenProps> = () => {

  const { t } = useTranslation()
  const navigation = useNavigation()
  const [phone, setPhone] = useState('')

  return (
    <View style={styles.container}>
      <View>
        <Image source={images.logo}
        style={styles.logoStyle}>
        </Image>
      </View>
      <View style={{ flex: 1, backgroundColor: colors.white, borderTopLeftRadius: 20, borderTopRightRadius: 20}}>
      <FloatingLabelInput
        label={'label'}
        value={phone}
        rightComponent={(
          <TouchableOpacity style={{ alignContent:'center', justifyContent:'center'}} onPress={()=>{console.log('X clicked')}}></TouchableOpacity>
        )}
        onChangeText={(val) => setPhone(val)}
      />
      </View>
    </View>
  )
}

export default SignInScreen;

【问题讨论】:

    标签: javascript react-native floating-labels


    【解决方案1】:

    1.3.5 或更高版本 - react-native-reanimated v2

    • 现在所有动画都使用 react-native-reanimated v2,因为它是 近日正式发布。请关注软件大厦 react-native-reanimated v2 的安装指南: https://docs.swmansion.com/react-native-reanimated/docs/installation

    • OBS.:如果在 Software Mansion 安装过程中指导您的项目 不会构建或构建但在启动时崩溃,请尝试删除 node_modules 文件夹。

    • OBS。 2:如果你不想使用新的 react-native-reanimated v2, 不要升级到这个版本,安装版本 1.3.4 和 react-native-reanimated@1.13.2

    https://github.com/Cnilton/react-native-floating-label-input#version-135-or-higher---react-native-reanimated-v2

    【讨论】:

      猜你喜欢
      • 2021-04-09
      • 2016-09-25
      • 2020-09-28
      • 2021-01-06
      • 2020-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多