Reactjs 如何在react native的功能部件中添加填隙admob ad?

Reactjs 如何在react native的功能部件中添加填隙admob ad?,reactjs,react-native,admob,Reactjs,React Native,Admob,我已经使用functional component在react native中创建了一个应用程序。现在我正试图在我的应用程序中添加admob。我看到了示例,但我可以看到它需要componentDidMount()来完成,这是一个类React.Component函数。我知道插入式广告对整个页面都是可见的,当DOM结构得到更新时,componentDidMount就会运行 但是我如何在功能组件中做同样的事情呢

我已经使用functional component在react native中创建了一个应用程序。现在我正试图在我的应用程序中添加admob。我看到了示例,但我可以看到它需要componentDidMount()来完成,这是一个类React.Component函数。我知道插入式广告对整个页面都是可见的,当DOM结构得到更新时,componentDidMount就会运行

但是我如何在功能组件中做同样的事情呢