2019-08-08 20:11:17 +02:00
|
|
|
import React from 'react'
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const myRef = React.createRef(null)
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
if (!myRef.current) {
|
|
|
|
console.error(`ref wasn't updated`)
|
|
|
|
}
|
2019-11-11 04:24:53 +01:00
|
|
|
})
|
2019-08-08 20:11:17 +02:00
|
|
|
|
|
|
|
return (
|
2019-11-11 04:24:53 +01:00
|
|
|
<Link href="/">
|
2019-08-08 20:11:17 +02:00
|
|
|
<a
|
|
|
|
ref={el => {
|
|
|
|
myRef.current = el
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
Click me
|
|
|
|
</a>
|
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
}
|