我在我的项目中下载了 react-native-material-calandarview。
他们只是提供一些代码来获取日历。https://github.com/NuclleaR/react-native-material-calendarview。
我在我的渲染()中使用了它。selectedDates={this.state.dates}......{this.state.dates} 它给出未定义。我需要选定的日期数组,但我无法得到。我在哪里得到选定的日期???尽快帮助我。提前致谢
日历向您展示了一个事件函数onDateChange
,您只需像这样在这个事件中设置状态:
<Calendar
selectedDates={this.state.dates}
onDateChange={data => {
// Add the data to your state here
// for example:
this.setState(state => { dates: state.dates.push(data.date) });
}}
/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句