0.1.11 • Published 5 years ago

@shopify/react-preconnect v0.1.11

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

@shopify/react-preconnect

Note: This module is now deprecated. You should move to using the <Preconnect /> component from @shopify/react-html instead.

Build Status License: MIT npm version npm bundle size (minified + gzip)

Reduces request latency by preconnecting hosts

Installation

$ yarn add @shopify/react-preconnect

Usage

This library default exports a <Preconnect /> component, which adds <link />s to <head></head> for the given hosts with dns-prefetch and preconnect relations.

import Preconnect from 'react-preconnect';

...

function App(props) {
  const preconnectHosts = [
    'api.example.com',
    'example.com',
    'example2.com',
  ]

  <Preconnect hosts={preconnectHosts} />
}

Interface

export interface Props {
  hosts: string[];
}
0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago