Skip to content

v2.7.0: React 17 support and absolute routes within a subpath

Compare
Choose a tag to compare
@molefrog molefrog released this 05 Feb 16:37

We're continuing to improve the library by keeping it small and simple, thanks to our wonderful contributors. First of all, it's the React 17 support: I'm sure many of you have already upgraded your project to the new version of React, which apparently "has no new features". Wouter now has proper peerDependencies that allow you to use it with React 17 thanks to @omgovich!

Another important update is that it's now possible to access the routes outside of the base scope when using a base parameter:

<Router base="/app">
  <Link href="/relative">Relative Link</Link>
  {/* 
      by prexing a path with tilda, you can reference a global route: when you click on this link 
      it navigates you to "/absolute", and not "/app/absolute" 
   */}
  <Link href="~/absolute">Absolute Link</Link>
</Router>

See #153 for more info. Credits @jvdsande