testRoutes.tsx 879 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import { Link, NavLink } from 'react-router-dom';
  3. import { RouterDebugger } from './RouterDebugger';
  4. import { RouteDescriptor } from './types';
  5. export const testRoutes: RouteDescriptor[] = [
  6. {
  7. path: '/test1',
  8. // eslint-disable-next-line react/display-name
  9. component: () =>
  10. (
  11. <>
  12. <h1>Test1</h1>
  13. <Link to={'/test2'}>Test2 link</Link>
  14. <NavLink to={'/test2'}>Test2 navlink</NavLink>
  15. </>
  16. ) as any,
  17. },
  18. {
  19. path: '/test2',
  20. // eslint-disable-next-line react/display-name
  21. component: () => (
  22. <>
  23. <h1>Test2 </h1>
  24. <Link to={'/test1'}>Test1 link</Link>
  25. <NavLink to={'/test1'}>Test1 navlink</NavLink>
  26. </>
  27. ),
  28. },
  29. {
  30. path: '/router-debug',
  31. // eslint-disable-next-line react/display-name
  32. component: () => RouterDebugger,
  33. },
  34. ];