Migración a v3
Cambios clave
Sección titulada «Cambios clave»Linkynavigateahora son estrictos para rutas internas.- Se agregaron
useLocationyuseParams. navigateacepta opciones{ replace, state }.RouterProvideragregabasenameynotFound.- Se introducen subpaths (
core,protected).
Ajustes recomendados
Sección titulada «Ajustes recomendados»1. Reemplazar navegación externa con <a>
Sección titulada «1. Reemplazar navegación externa con <a>»Antes:
<Link to="https://externo.com">Externo</Link>Ahora:
<a href="https://externo.com" target="_blank" rel="noopener noreferrer">Externo</a>2. Actualizar imports
Sección titulada «2. Actualizar imports»Antes:
import { RouterProvider, Link, useNavigate, Protected } from '@arielgonzaguer/michi-router';Ahora:
import { RouterProvider, Link, useNavigate } from '@arielgonzaguer/michi-router/core';import { Protected } from '@arielgonzaguer/michi-router/protected';3. Usar fallback explícito
Sección titulada «3. Usar fallback explícito»<RouterProvider routes={routes} notFound={<NotFound />} />Checklist post-migración
Sección titulada «Checklist post-migración»- No hay
Linkcon URLs externas. -
Protected.redirectionPathes interna. - Las rutas dinámicas usan
:param. - Los imports usan
core/protectedcuando aplica.