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

Updated installation page code snippet #1579

Merged
merged 1 commit into from
Sep 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/src/app/components/pages/get-started/installation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ class Installation extends React.Component {

render() {
let usageCode =
'/** MyAwesomeReactComponent.jsx */\n\n' +
'let React = require(\'react\'),\n' +
' mui = require(\'material-ui\'),\n' +
' RaisedButton = mui.RaisedButton;\n\n' +
'let MyAwesomeReactComponent = React.createClass({\n\n' +
'// get constant references to React and Material-UI\n' +
'// components, as we will not be modifying these\n\n' +
'const React = require(\'react\');\n\n' +
'// it is good practice to require only those components of\n' +
'// Material-UI that your app needs, instead of requiring all of\n' +
'// Material-UI. This will make your build process faster and\n' +
'// your build output smaller\n\n' +
'const RaisedButton = require(\'material-ui/lib/raised-button\');\n\n' +
'// see node_modules/material-ui/lib/index.js for a mapping of\n' +
'// Material-UI components to require() calls\n\n' +
'const MyAwesomeReactComponent = React.createClass({\n\n' +
' childContextTypes: {\n' +
' muiTheme: React.PropTypes.object\n' +
' },\n\n' +
Expand Down
9 changes: 4 additions & 5 deletions examples/webpack-example/src/app/components/main.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/** In this file, we create a React component which incorporates components provided by material-ui */

let React = require('react');
let mui = require('material-ui');
let RaisedButton = mui.RaisedButton;
let Dialog = mui.Dialog;
let ThemeManager = new mui.Styles.ThemeManager();
let Colors = mui.Styles.Colors;
let RaisedButton = require('material-ui/lib/raised-button');
let Dialog = require('material-ui/lib/dialog');
let ThemeManager = new (require('material-ui/lib/styles/theme-manager'))();
let Colors = require('material-ui/lib/styles/colors');

let Main = React.createClass({

Expand Down