New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@getaround-eu/use-route-params

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getaround-eu/use-route-params

A hook to get typed params from route

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@getaround-eu/use-route-params

license package version

Get your params typed from the route

What's it?

useRouteParams is a hook which, used with react-router-dom v6, allows you to directly get the typed params from a provided route path.

Install

Supposing that you already have react-router-dom installed:

yarn add @getaround-eu/use-route-params
# or
npm -i @getaround-eu/use-route-params

Usage

import useRouteParams from "@getaround-eu/use-route-params"

const MY_COMPONENT_PATH = "/here/:is/:a/route/toMyComponent"


const MyComponent = () => {
  const { a, is } = useRouteParams(MY_COMPONENT_PATH)

  return (...)
}

// This way the route is always bound to the component
MyComponent.routePath = MY_COMPONENT_PATH

export default MyComponent

What is Getaround?

Getaround connects safe, convenient and affordable cars with people who need them to live and work. We aim to create the world's best carsharing marketplace that make sharing vehicles superior to owning them. Our community includes people who rely on our cars for on-demand mobility, and owners who share cars on our platform, including those who operate their own carsharing businesses.

Our vision is to make our cities and communities better places to live by:

  • Empowering people with convenient access to the cars they need, whenever they need them.
  • Improving mobility by relieving congestion and making public transit easier to use.
  • Protecting our environment by reducing pollution and advancing sustainable energy.

As a reminder the biggest carbon emitter in most countries are the cars, and this is what we have an impact on at Getaround.

You can learn more about Getaround on our tech blog.

Keywords

FAQs

Package last updated on 05 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc