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

TypeError: Cannot read property 'toUpperCase' of undefined - NavigationClose #1447

Closed
raptoria opened this issue Aug 18, 2015 · 1 comment
Closed
Labels
customization: css Design CSS customizability package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. v0.x

Comments

@raptoria
Copy link

I'm getting the following error
Warning: React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components).
warning.js:48 Warning: Only functions or strings can be mounted as React components.
createRouter.js:275 Uncaught TypeError: Cannot read property 'toUpperCase' of undefined

If I remove NavigationClose from the AppBar, the error goes away.

currently running React v 0.13.1
react-router v 0.13.2
material-ui v 0.10.4

Code:

    import React from 'react';
    import styles from './Header.css';
    import mui from 'material-ui';

    let IconButton = mui.IconButton;
    let NavigationClose = mui.NavigationClose;
    let FlatButton = mui.FlatButton;
    let ThemeManager = new mui.Styles.ThemeManager();
    let AppBar = mui.AppBar;

    let injectTapEventPlugin = require('react-tap-event-plugin');
    injectTapEventPlugin();


    class Header extends React.Component{

      getChildContext() {
        return {
          muiTheme: ThemeManager.getCurrentTheme()
        };
      }

      render() {
        return (
          <AppBar
          title="Title"
          iconElementLeft={<IconButton><NavigationClose /></IconButton>}
          iconElementRight={<FlatButton label="Save" />} />
        );
      }

    }

    Header.childContextTypes = {
      muiTheme: React.PropTypes.object
    };

    export default Header;
@raptoria raptoria changed the title Missing loader for transitions inside src/styles Missing loader for transitions cubic-bezier(0.445, 0... inside src/styles Aug 18, 2015
@raptoria raptoria changed the title Missing loader for transitions cubic-bezier(0.445, 0... inside src/styles TypeError: Cannot read property 'toUpperCase' of undefined Aug 19, 2015
@raptoria raptoria changed the title TypeError: Cannot read property 'toUpperCase' of undefined TypeError: Cannot read property 'toUpperCase' of undefined related to IconButton Aug 19, 2015
@raptoria raptoria changed the title TypeError: Cannot read property 'toUpperCase' of undefined related to IconButton TypeError: Cannot read property 'toUpperCase' of undefined - IconButton Aug 19, 2015
@raptoria raptoria changed the title TypeError: Cannot read property 'toUpperCase' of undefined - IconButton TypeError: Cannot read property 'toUpperCase' of undefined - NavigationClose Aug 19, 2015
@raptoria
Copy link
Author

raptoria commented Sep 9, 2015

Figured it out:
let CloseButton = require('material-ui/lib/svg-icons/navigation/close');

@raptoria raptoria closed this as completed Sep 9, 2015
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added v0.x package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. customization: css Design CSS customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: css Design CSS customizability package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. v0.x
Projects
None yet
Development

No branches or pull requests

3 participants