add props interfaces for AuthProvider, CustomBrowserRouter

This commit is contained in:
Sidney Alcantara
2019-09-22 23:50:22 +10:00
parent 575e557ac7
commit 9fb7569af3
2 changed files with 10 additions and 2 deletions

View File

@@ -2,7 +2,11 @@ import React, { useEffect, useState } from "react";
import { auth } from "./firebase";
import AuthContext from "./contexts/authContext";
export const AuthProvider = ({ children }: any) => {
interface IAuthProviderProps {
children: React.ReactNode;
}
export const AuthProvider: React.FC<IAuthProviderProps> = ({ children }) => {
const [currentUser, setCurrentUser] = useState();
useEffect(() => {

View File

@@ -3,7 +3,11 @@ import { BrowserRouter, Route } from "react-router-dom";
export const RouterContext = React.createContext({});
const CustomBrowserRouter = ({ children }: any) => (
interface ICustomBrowserProps {
children: React.ReactNode;
}
const CustomBrowserRouter: React.FC<ICustomBrowserProps> = ({ children }) => (
<BrowserRouter>
<Route>
{routeProps => (