display: flex; //设置flex必须要设置父元素
justify-content: center; // X轴居中
align-items: center; // y轴居中
*错误边界
Class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {
errorlnfo: null
};
}
static getDerivedStateFromError (error) {
console.log(error, 'rror222222);
//更新state使下一-次渲染可以显示降级UI