File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed
examples/with-react-md/pages Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change 11import Head from 'next/head'
22import Link from 'next/link'
33
4+ import { PureComponent } from 'react'
5+
46import Avatar from 'react-md/lib/Avatars'
57import Button from 'react-md/lib/Buttons/Button'
68import FontIcon from 'react-md/lib/FontIcons'
@@ -28,17 +30,23 @@ const drawerHeaderChildren = [
2830 />
2931]
3032
31- const NavigationLink = ( props ) => {
32- const { href, as, children, ..._props } = props
33- return (
34- < div { ..._props } >
35- < Link href = { href } as = { as } >
36- < a className = 'md-list-tile' style = { { padding : 0 , overflow : 'hidden' } } >
37- { children }
38- </ a >
39- </ Link >
40- </ div >
41- )
33+ class NavigationLink extends PureComponent {
34+ // NOTE: Don't try using Stateless (function) component here. `ref` is
35+ // required by React-MD/AccessibleFakeButton, but Stateless components
36+ // don't have one by design:
37+ // https://github.com/facebook/react/issues/4936
38+ render ( ) {
39+ const { href, as, children, ..._props } = this . props
40+ return (
41+ < div { ..._props } style = { { padding : 0 } } >
42+ < Link href = { href } as = { as } >
43+ < a className = 'md-list-tile md-list-tile--mini' style = { { width : '100%' , overflow : 'hidden' } } >
44+ { children }
45+ </ a >
46+ </ Link >
47+ </ div >
48+ )
49+ }
4250}
4351
4452export default ( ) => {
You can’t perform that action at this time.
0 commit comments