Skip to content

Commit

Permalink
Import from individual react-dates component (WordPress#21914)
Browse files Browse the repository at this point in the history
This avoids the tree-shaking issues in `react-dates` that end up causing
too much of the library to be imported when importing from the index.
  • Loading branch information
sgomes authored Apr 27, 2020
1 parent 9b07cca commit ee58c81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/date-time/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* External dependencies
*/
import moment from 'moment';
import { DayPickerSingleDateController } from 'react-dates';
// react-dates doesn't tree-shake correctly, so we import from the individual
// component here, to avoid including too much of the library
import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';

/**
* WordPress dependencies
Expand Down

0 comments on commit ee58c81

Please sign in to comment.