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 1
1
import Head from 'next/head'
2
2
import Link from 'next/link'
3
3
4
+ import { PureComponent } from 'react'
5
+
4
6
import Avatar from 'react-md/lib/Avatars'
5
7
import Button from 'react-md/lib/Buttons/Button'
6
8
import FontIcon from 'react-md/lib/FontIcons'
@@ -28,17 +30,23 @@ const drawerHeaderChildren = [
28
30
/>
29
31
]
30
32
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
+ }
42
50
}
43
51
44
52
export default ( ) => {
You can’t perform that action at this time.
0 commit comments