Skip to content

Upgrading to 0.25.0 ​

Breaking changes ​

Route and match types ​

The Route type arguments have changed. Replace manually supplied generic arguments with typeof yourRoute where possible.

Created route definitions no longer expose matched; use the last entry in matches when inspecting a definition. Resolved routes still expose matched. Match records store view definitions in views instead of component, components, and props.

Deprecations ​

View options ​

The component and components options and the second props argument to createRoute are superseded by addView. Move each component and its props getter into a separate addView call.

ts
// Before
const user = createRoute({
  name: 'user',
  path: '/users/[id]',
  component: UserPage,
}, (route) => ({ userId: route.params.id }))

// After
const user = createRoute({
  name: 'user',
  path: '/users/[id]',
})
  .addView(UserPage, {
    props: (route) => ({ userId: route.params.id }),
  })

For named views, replace each entry in components with an addView call and pass its name in the options.

The old syntax is removed in 0.28.0. See Views and Component Props.

Full release notes.