Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows requiring individual components #585

Merged
merged 4 commits into from
Apr 27, 2015
Merged

Conversation

mmrtnz
Copy link
Contributor

@mmrtnz mmrtnz commented Apr 27, 2015

var Checkbox = require('material-ui/lib/Checkbox');
var EnhancedButton = require('material-ui/lib/EnhancedButton');

instead of

var {Checkbox, EnhancedButton) = require('material-ui');
  • Some components return an index.js and require an additional step, for example:
var MenuComponents = require('material-ui/lib/menu'); // Returns an object pointing to Menu components
var Menu = MenuComponents.Menu;
var MenuItem = MenuComponents.MenuItem;
...
var {Menu, MenuItem} = require('material-ui/lib/menu'); // Alternative approach using destructuring

these include

  • Menu
  • Styles
  • Tabs
  • Toolbar
  • Utils

hai-cea pushed a commit that referenced this pull request Apr 27, 2015
Allows requiring individual components
@hai-cea hai-cea merged commit 383b820 into mui:css-in-js Apr 27, 2015
@zannager zannager added the package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants