Skip to content

Commit 05a5d50

Browse files
fix: path should be optional
* applied for index / Outlet routes
1 parent efadf0c commit 05a5d50

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

example/routes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ export const routes: IRoutesConfig = {
8787
},
8888
{
8989
path: ':id',
90-
component: <Outlet/>,
90+
component: <Outlet />,
9191
children: [
9292
{
9393
index: true,
94-
component: <NestedPrivatePage />
94+
component: <NestedPrivatePage />,
9595
},
9696
{
9797
path: 'update',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.4.3",
2+
"version": "0.4.4",
33
"license": "MIT",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ single route interface `IRoute`
253253
```typescript
254254
export interface IRoute {
255255
/** a valid react-router-dom v6 path */
256-
path: string;
256+
path?: string;
257257

258258
/** the component to be rendered under the path */
259259
component: React.ReactElement;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
export interface IRoute {
44
/** a valid react-router-dom v6 path */
5-
path: string;
5+
path?: string;
66

77
/** the component to be rendered under the path */
88
component: React.ReactElement;

0 commit comments

Comments
 (0)