A previous issue was closed dealing with how to initialize the injectTapEventPlugin function. However, after having solved that according to the issue, I'm still getting errors using a dropdown menu in material-ui.
Code:
const Header = (props) => {
const { position, referralLink } = props;
return (
<AppBar
className="flex-container-left appbar"
title={(
<a href="/" className="logo-title">
<img src="/static/images/image.svg" height="50" alt="company logo"/>
</a>
)}
iconElementLeft={<span />}
iconElementRight={(
<IconMenu
className="navigation-close"
iconButtonElement={<IconButton><NavigationMenu /></IconButton>}
targetOrigin={{ horizontal: 'right', vertical: 'top' }}
anchorOrigin={{ horizontal: 'right', vertical: 'top' }}
>
<MenuItem
primaryText="Home"
onTouchTap={() => console.log('/home')}
/>
<MenuItem
primaryText="Status & Leaderboard"
onTouchTap={() => console.log('/status')}
/>
</IconMenu>
)}
/>
);
}
Error:


@tgoldenberg is it possible to have a sample repo? It's quite hard to figure it out like this.
@arunoda sure, I'll try to get one ready.
I would like to just share my experience with React-MD, which is an alternative implementation of Google Material UI for React. React-MD just works with Next.js like a charm for me.
Here's a sample repo: https://github.com/tgoldenberg/next-sample
@frol Are you using a custom webpack config to get it working?
@tgoldenberg I'll have a look at this too.
May be this issue is related too: https://github.com/zeit/next.js/issues/882#issuecomment-275940934
@ugiacoman No, I have just installed it (npm install --save react-md), import it (import ... from 'react-md/...'), and added compiled CSS files and fonts using <Head>. That is it.
@frol, I'll checkout react-md, but I think the issue still remains. A lot of people use material-ui, and migrating isn't always that easy.
@frol could you please elaborate on how you compile and add compiled files to Head? (I'm new to next.js)
Hey, just update to next 2.0.0-beta.20 and adapt your jsx styling. For testing I commented out
Your button was working then.
/Jan
@alexedev @tgoldenberg I have just PRed the example of using React-MD with Next.js: #940
@frol great, thank you
Still having this problem with 2.0.0-beta.24
Most helpful comment
Here's a sample repo: https://github.com/tgoldenberg/next-sample