Open allroad88888888 opened 5 years ago
It seems like this is caused because the constructor calls this.selectDate, but when the visibility changes it calls this.shortcutSelect, which sets the values correctly. Is there a reason that this.shortcutSelect is not called in the constructor?
I hacked a fix by wrapping the mobile calendar like below
import React from "react";
import {Calendar} from 'antd-mobile';
export default class MobileCalendar extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
};
}
componentDidMount(){
this.setState({
visible: true
})
}
render() {
const { ...props } = this.props;
return (
<Calendar {...props} visible={this.state.visible}/>
);
}
}
如题