是否可以将反应本机日历的 subtractMonth() 函数转发到不同的组件,如按钮?

Is it possible to forward subtractMonth() function of react native calendars to a different component like a button?

我正在为一个应用程序构建一个日历页面,并希望月份和月份更改箭头显示在日历旁边而不是日历顶部。所以我删除了 header 组件,在它旁边创建了一个 View 组件。但是我无法弄清楚如何在按下下个月按钮时更改月份。

Here is an image of the screen for reference

可能使用 refs

const calendarRef = React.useRef()
<Calendar ref={calendarRef}/>

现在您可以将 calendarRef 传递给其他组件并使用它

calendarRef.addMonth(-1)

注意:在此处找到 https://github.com/wix/react-native-calendars/issues/764