React组件内部怎么调用全局函数

#1

在index.html中定义了一个全局a函数,在一个组件中去调用a()函数,提示a is not defined我用的react是16.2.0

#2

window.a = function() {}