关于react-native中的函数语法问题

看react-native中看到这样的函数写法:

 _handleStartShouldSetPanResponder: function(e: Object, gestureState: Object): boolean {
    // Should we become active when the user presses down on the circle?
    return true;
  },

  _handleMoveShouldSetPanResponder: function(e: Object, gestureState: Object): boolean {
    // Should we become active when the user moves a touch over the circle?
    return true;
  },

就是想单纯的问一下这是不是ES6的语法呢..这样写法是什么意思呢,以前在用ES6的时候也没有发现别的地方有这样的写法...

谢谢~

阅读 3.7k
2 个回答

应该是使用了typescript写的吧

没错的话,这是 flow 的类型检查吧!也有可能是 ts 写的。

传送门

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题