@shopify/react-preconnect
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published

@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[];
}

Readme

Keywords

none

Package Sidebar

Install

npm i @shopify/react-preconnect

Weekly Downloads

0

Version

0.1.11

License

MIT

Unpacked Size

5.41 kB

Total Files

11

Last publish

Collaborators

  • jaimie.rockburn
  • blittle
  • shopify-admin
  • maryharte
  • crisfmb
  • pmoloney89
  • netlohan
  • st999999
  • justin-irl
  • megswim
  • wcandillon
  • nathanpjf
  • shopify-dep
  • goodforonefare
  • lemonmade
  • vsumner
  • wizardlyhel
  • antoine.grant
  • tsov
  • andyw8-shopify
  • henrytao
  • hannachen
  • vividviolet
  • bpscott