Material-ui-pickers: Using DatePicker component without wrapper

Created on 8 Jan 2018  路  3Comments  路  Source: mui-org/material-ui-pickers

First of all, thanks for all you're work on this project. The pickers look great!

Environment

| Tech | Version |
|---------------------|---------|
| material-ui-pickers | ^1.0.0-beta.12 |
| material-ui | ^1.0.0-beta.23 |
| React | ^16.2.0 |
| Browser | Chrome 63.0.3239.84 64bit |
| Platform | MacOS High Sierra 10.13.2 |

Issue

Right now to use the components such as DatePicker without their wrapper and text field, you have to import from material-ui-pickers/src/.... The problem with this is that the code is not run through babel and transpiled at this point, so while this works for webpack, which does the transpiling itself, it does not work in all settings. In my case, I'm running into trouble with my SSR setup.

Expected behavior

It would be nice to make the wrappers explicit and export them from the index script, i.e. import {DatePickerDialog, DatePicker} from 'material-ui-pickers'. Or maybe material-ui style: import DatePickerDialog from 'material-ui-pickers/DatePickerDialog'. I'm happy to help if needed.

Most helpful comment

You can do it now with

import DatePickerDialog from 'material-ui-pickers/DatePicker/DatePicker'

All 3 comments

Funny timing, I was actually coming to the issues to ask how to use the dialog only 馃槃 馃憤

You can do it now with

import DatePickerDialog from 'material-ui-pickers/DatePicker/DatePicker'

Great, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

killjoy2013 picture killjoy2013  路  3Comments

Lysander picture Lysander  路  3Comments

callmeberzerker picture callmeberzerker  路  3Comments

cranst0n picture cranst0n  路  4Comments

aditya81070 picture aditya81070  路  3Comments