Skip to content

Commit 7323197

Browse files
add: manually children prop
* for React 18 support
1 parent 9b01efa commit 7323197

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.4",
2+
"version": "0.4.5",
33
"license": "MIT",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",

src/context/provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { IRouterContextProps } from '../types';
33
import { RouterContext } from './context';
44

5-
const RouterProvider: React.FC<IRouterContextProps> = (props) => {
5+
const RouterProvider = (props: IRouterContextProps) => {
66
const { children, routes, isAuth, userRole } = props;
77

88
return (

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,7 @@ export interface IRouterContextProps {
7070

7171
/** current user role that will be validated for accessing a specific route */
7272
userRole?: string[] | string; // support for multiple roles
73+
74+
/** React 18 TS support */
75+
children?: React.ReactNode;
7376
}

0 commit comments

Comments
 (0)