react-native - Flow Promise 此类型与 undefined undefined 不兼容

标签 react-native flowtype exponent expo

获取警告 enter image description here

在线:

enter image description here

使用 Flow.js v.0.48.0。 代码示例:

...
import { Font, AppLoading } from 'expo';
...
export default class App extends Component {
  async componentDidMount() {
    await Font.loadAsync(fontsStore);
    ...
  }
  ...
}

最佳答案

找到黑客解决方案:

...
  componentDidMount() {
    this.loadFonts();
  }

  async loadFonts () {
    await Font.loadAsync(fontsStore);

    this.setState({ fontLoaded: true });
  }
...

关于react-native - Flow Promise 此类型与 undefined undefined 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44611750/

相关文章:

node.js - npm react-native-fetch-blob - "RNFetchBlob.fetch is not a function"

javascript - 无法从 Firebase 读取 JSON 值

node.js - 我如何在 Cypress 中使用流程?

javascript - 流类型 - 数组对象

javascript - 为什么 `{ a: string }`不能流入 `{ a?: string }`

c - 如何从 32 位 float 中提取符号、尾数和指数

react-native - 单击选项卡时重新渲染组件

React-Native 语音转文本

java - 函数返回 NaN

javascript - 电源列表的最后一位