Skip to content

Instantly share code, notes, and snippets.

View ertanhasani's full-sized avatar

Ertan Bera ertanhasani

  • Stockholm, Sweden
View GitHub Profile
@ertanhasani
ertanhasani / LinkSmoothScroll.js
Last active May 22, 2021 18:39 — forked from vinaypuppal/LinkSmoothScroll.js
Next.js smooth scrolling
import React, { Children } from 'react'
import Router from 'next/router'
import smoothScroll from '../utils/smoothScroll'
// this HOC is taken from https://github.com/zeit/next.js/blob/master/lib/link.js and modified
export default class LinkSmoothScroll extends React.Component {
constructor (props) {
super(props)
this.linkClicked = this.linkClicked.bind(this)
}