Closed achtan closed 8 years ago
Are you sure? I checked the build on npm and everything looks ok.
I'm getting the same issue as well. Kindly let me know if i have missed anything.
Oh I think you're right. Only the specific components seem exported here https://github.com/tleunen/react-mdl/blob/master/src/index.js
Loading specific components we get an error "Cannot read property 'upgradeElement' of undefined". I tried using Button and checkbox component.
Do you load the material.js file before using React-MDL?
This is required to get the upgradeElement
. Read: https://github.com/tleunen/react-mdl#requirements
I know this is not ideal and will be resolved in the next major version.
Thank you so much for your valuable response. Awaiting for the next major version.
Btw, to resolve the undefined issue when using this import ReactMDL from 'react-mdl';
You can use this instead:
import * as ReactMDL from 'react-mdl';
But I highly suggest you to grab the specific components you want by using the direct path to the component react-mdl/lib/Button
or using this syntax: import { Button } from 'react-mdl
.
version
1.5.4