jiexishede
jiexishede

Reputation: 2613

material-ui, component does not work

I looked the code on http://www.material-ui.com/#/components/raised-button.

When I does not use the material-ui, the Nav work well.

5:8 warning 'RaisedButton' is defined but never used no-unused-vars
15:11 warning 'style' is assigned a value but never used no-unused-vars
22:10 error 'MuiThemeProvider' is not defined react/jsx-no-undef
22:37 error 'muiTheme' is not defined no-undef
26:14 error 'RaiseButton' is not defined react/jsx-no-undef
26:39 warning Style prop value must be an object react/style-prop-object
27:14 error 'RaiseButton' is not defined react/jsx-no-undef
27:39 warning Style prop value must be an object react/style-prop-object

import RaisedButton from 'material-ui/RaisedButton';

class Nav extends Component {
  render () {
    const style = {
      margin: 12,
    };
    return (
        <nav>
            <RaiseButton label="机构管理" style="{style}"  containerElemet={<Link to="/"></Link>} />
            <RaiseButton label="报名成员" style="{style}" containerElemet={<Link to="/apply"></Link>} />
            <RaiseButton label="全部成员" style="{style}"  containerElemet={<Link to="/driftMember"></Link>}/>
            <RaiseButton label="全部成员" style="{style}" containerElemet={<Link to="/allMember"></Link>}/>
            <RaiseButton label="文案设置" style="{style}" containerElemet={<Link to="/textSet"></Link>} />
        </nav>
    );
  }
}

Upvotes: 0

Views: 1322

Answers (1)

user7705625
user7705625

Reputation:

You have a typo in your code. It's "Raised" Button, not "Raise".

EDIT:

Also, note that style="{style}" should be style={style} without the quotes

and containerElemet should be containerElement (you missed the n)

Upvotes: 2

Related Questions