Skip to content

Commit 7323197

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

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
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

+1-1
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

+3
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)