Preloader.tsx 343 字节
Newer Older
P
Peter Pan 已提交
1
import React, {FunctionComponent} from 'react';
2

P
Peter Pan 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15
import Head from 'next/head';

type PreloaderProps = {
    url: string;
};

const Preloader: FunctionComponent<PreloaderProps> = ({url}) => (
    <Head>
        <link rel="preload" href={process.env.API_URL + url} as="fetch" crossOrigin="anonymous" />
    </Head>
);

export default Preloader;