首页 > 解决方案 > react-native-camera 从相机屏幕返回时运行缓慢

问题描述

在我执行此操作之前,它在向前导航到相机屏幕时也会运行缓慢:

componentDidMount() {
    super.componentDidMount();

    // 延迟处理
    InteractionManager.runAfterInteractions(() => {
        this.setState({
            created: true
        });
    });
}

render() {
    return <View style={PublicStyles.screenView}>
        {this.state.created ? <RNCamera/> : null}
    </View>
}

那么,我应该怎么做才能解决导航返回时发生的问题?

标签: react-nativereact-native-camera

解决方案


推荐阅读