gpt4 book ai didi

react-native 动画节点错误

转载 作者:行者123 更新时间:2023-12-03 15:57:52 26 4
gpt4 key购买 nike

我的项目有问题。

Animated Node with tag 7 not exists

type error: expected dynamic type 'double' but had type 'null'

在呈现此表单之前,应用程序会不时出现错误,但并不总是出现错误。我认为只有当互联网不是很好。但我希望能够处理这个错误,所以它不会出现在用户面前。

我的代码如下。

表单主体.js

import React, { Component } from 'react';
import { View, Text, ScrollView, Alert, BackHandler } from 'react-native';
import RNExitApp from 'react-native-exit-app';
import ScrollableTabView from 'react-native-scrollable-tab-view';
import { Actions } from 'react-native-router-flux';
import axios from 'axios';
import { connect } from 'react-redux';
import { modificaToken, modificaConsultas, modificaScene } from '../actions/AutenticacaoActions';

import FormFaturamento from './FormFaturamento';
import FormListaConsultas from './FormListaConsultas';

class formPrincipal extends Component {

componentWillMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleAndroidBack)
}

componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleAndroidBack)
}

handleAndroidBack = () => {

if(Actions.currentScene === 'formPrincipal') {
Alert.alert(
'Sair',
'Deseja sair do app?',
[
{ text: 'NÃO', onPress: () => {} },
{ text: 'SIM', onPress: () => RNExitApp.exitApp() },
]
);
return true;
}
}

render() {
return(
<ScrollableTabView>
{this.props.consultas.map( item => <FormListaConsultas tabLabel={item.Grupo} key={item.Grupo} item={item}/>)}
</ScrollableTabView>
)
}
}

const mapStateToProps = state => (
{
token: state.AutenticacaoReducer.token,
consultas: state.AutenticacaoReducer.consultas,
scene: state.AutenticacaoReducer.scene,
listaConsultas: state.AutenticacaoReducer.listaConsultas
}
)

export default connect(mapStateToProps, {modificaToken, modificaConsultas, modificaScene})(formPrincipal);

最佳答案

我通过关闭 Android 的 native 动画驱动程序解决了这个错误。我不确定这是一个真正的答案,但它为我修复了这个特定的错误。

Animated.timing(someAnimation, {
duration: 5000,
toValue: 1,
useNativeDriver: false,
}).start();

关于react-native 动画节点错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46203907/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com