📅  最后修改于: 2022-03-11 15:03:34.207000             🧑  作者: Mango
import React from "react";
export default class App extends React.Component {
state = {
date: ""
};
componentDidMount() {
this.getDate();
}
getDate = () => {
var date = new Date().toDateString();
this.setState({ date });
};
render() {
const { date } = this.state;
return {date};
}
}
}
export default App;