Router Resource

Router Resource

This resource is used to interact with the router functionality.

Methods

Push

Pushes a new route to the router

Arguments
props
object
(required)
Argument example
{
  pathname: "/test-route",
  query: {
    test: "test",
  },
}
Examples

      // Navigate to a new route
      __nylaResources.router.push({
        pathname: '/test-route'
      })
      
      // Push some query params and navigate to a new route
      __nylaResources.router.push({
        pathname: '/test-route',
        query: {
          test: 'test'
        }
      })
      
      // Push some query params to the current route
      __nylaResources.router.push({
        query: {
          test: 'test'
        },
      })