router nextjs
import { useRouter } from 'next/router'
function ActiveLink({ children, href }) {
const router = useRouter()
const handleClick = (e) => {
e.preventDefault()
router.push(href)
}
return (
<a href={href} onClick={handleClick} style={style}>
{children}
</a>
)
}
export default ActiveLink
Also in JavaScript:
- indexof javascript duplicate arrays
- JS get min date
- change the value in checkbox by button react
- based on scroll position and get data attribute javascript
- calculate time difference in javascript
- await on observable
- javascript all type of data
- document ready js
- check if object is present in array javascript
- firebase cloud functions send email
- disable input angular
- javascript http request
- clear terminal node js
- javascript if has jquery loaded
- javascript console mensaje
- create global variable inside function JavaScript
- javascript convert number to spreadsheet column
- js number 2 decimal places
- slide when mouse over gadget jquery
- comand component create struct angular
- get select option count using jquery
- arraylist to json array
- how to connect react to backend
- javascript remove final newline from string