ghost-portal/packages/test-support/src/react/apiInTests.ts
Jaco 4929b1c6fd
Update headers for 2023 (#8665)
* Update headers for 2023

* Adjust env-config
2023-01-01 10:32:05 +02:00

13 lines
390 B
TypeScript

// Copyright 2017-2023 @polkadot/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { PropsWithChildren } from 'react';
import { useApi } from '@polkadot/react-hooks';
export const WaitForApi = ({ children }: { children: React.ReactNode }): PropsWithChildren<any> | null => {
const api = useApi();
return api.isApiReady ? (children) : null;
};