wouter
wouter copied to clipboard
🥢 A minimalist-friendly ~2.1KB routing for React and Preact
## Background The flattenChildren method uses the reduce - map pattern on MDN [Array.prototype.flat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) docs. MDN [Array.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap) is the same pattern but claims to be slightly faster and is less...
There are cases where we need a working ref to rendered link dom node, it would really be helpful if this gets into the code.
Currently, TypeScript can't find the type declarations for the module specifiers listed in the exports map. This PR fixes this.
Hello @molefrog, I'm following up on the issue[ ctrl + click to open link in new tab not working #68 (closed) ](https://github.com/molefrog/wouter/issues/68) On MacOS the combination is not `ctrl +...
Maybe we also need another way to pass parameters. just like this: ```js const [, navigator] = useLocation(); navigate(path: string, replace?: boolean, state?: object); // and ``` @omgovich @molefrog
In the latest version of wouter, when the location is `somewebsite.com/users?name=john` ```typescript const [location] = useLocation(); ``` `location` only retrieves `/users` emitting `?name=john`. And even though I push new query...
Is there a way to use the active css selector on the Link component? I know react router handles this with the NavLink component. Is there an equivalent in wouter?
You need to make a custom hook `useParams` to get the route parameters. ```js import { useParams } from "wouter" const Component = (props) => { const { id }...