1

Here is output in browserI don't know what is happening with react-dates. I am taking awful designs, that worked just some months ago.

[![enter image description here][1]][1]import 'react-dates/initialize';
import React from 'react';
import monent from 'moment';
import 'react-dates/lib/css/_datepicker.css';
import {SingleDatePicker} from 'react-dates';

<SingleDatePicker date={this.state.createdAt} onDateChange={this.onDateChange} focused={this.state.calendarFocused} displayFormat="DD-MM-YYYY" onFocusChange={this.onFocusChange} id="1"/>

4

1 回答 1

1

刚刚在 React 应用程序中遇到了这个问题。出于某种原因,我的 CSS 文件没有包含在我的构建中,并且我得到了与您的屏幕截图相同的丑陋 UI。

我将 CSS 复制到自己的文件中,而不是使用 WebPack 导入并修复。希望这对其他人有帮助。

于 2019-11-21T01:58:23.460 回答