This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@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

1

Version

0.1.11

License

MIT

Unpacked Size

5.41 kB

Total Files

11

Last publish

Collaborators

  • jaimie.rockburn
  • jaykay101
  • maryharte
  • mishsmelle
  • netlohan
  • pmoloney89
  • shopify-admin
  • shopify-dep