react-native - react-native-camera 从相机屏幕返回时运行缓慢
问题描述
在我执行此操作之前,它在向前导航到相机屏幕时也会运行缓慢:
componentDidMount() {
super.componentDidMount();
// 延迟处理
InteractionManager.runAfterInteractions(() => {
this.setState({
created: true
});
});
}
render() {
return <View style={PublicStyles.screenView}>
{this.state.created ? <RNCamera/> : null}
</View>
}
那么,我应该怎么做才能解决导航返回时发生的问题?
解决方案
推荐阅读
- html - 如何防止自定义 html 内容弄乱我的页面布局
- javascript - 重用 React 组件中的所有内容,除了它的 render 方法
- python - Scikit-Learn 管道拟合和转换错误
- bash - 我怎样才能清理这个领域?
- python - pandas str.split 给了我一个意外的语法错误
- anova - R:重复测量数据 - 如何将重要性放入条形图中
- javascript - 使用 ngIf 的 Angular ngStyle 动态样式元素
- visual-studio-code - 为什么一个 React JavaScript 文件在 VScode 中缩进 4 个空格,而所有其他文件缩进 2 个
- javascript - react-redux:请求失败,状态码 404
- c - 如何计算二叉树中的叶子数量而不用C递归?