diff --git a/src/core.tsx b/src/core.tsx index 19475cc..dae9b87 100644 --- a/src/core.tsx +++ b/src/core.tsx @@ -1,4 +1,4 @@ -import type { ReactNode } from "react" +import type { FC, ReactNode } from "react" import type { Address, Fetcher, @@ -69,16 +69,12 @@ const NftContext = createContext<{ fetcher?: Fetcher | null } | null>(null) -function NftProvider({ - children, - fetcher, -}: { +const NftProvider: FC<{ children: ReactNode fetcher?: Fetcher | FetcherDeclaration | null -}): JSX.Element { - const normalizedFetcher = normalizeFetcher(fetcher) +}> = function NftProvider({ children, fetcher }) { return ( - + {children} ) diff --git a/src/utils.tsx b/src/utils.tsx index f01332d..2d644c2 100644 --- a/src/utils.tsx +++ b/src/utils.tsx @@ -221,8 +221,8 @@ export function promiseAny(promises: Promise[]): Promise { Promise.all([...promises].map(reversePromise)) ) as Promise } -export function reversePromise(promise: Promise) { - return new Promise((resolve, reject) => +export function reversePromise(promise: Promise): Promise { + return new Promise((resolve, reject) => { Promise.resolve(promise).then(reject, resolve) - ) + }) }