useNavigator

A helper hook to simplify navigation

Import

import {useNavigator} from 'react-animated-navigator';
const [go, history, location] = useNavigator()

Returns

go: function(to: string|object|number|function, transition: string?, duration: number?)

history: object

A react-router's history object

location: object

A react-router's current location object