How to use the @shopify/react-network.useNetworkManager function in @shopify/react-network

To help you get started, we’ve selected a few @shopify/react-network examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / quilt / packages / react-cookie / src / CookieUniversalProvider.tsx View on Github external
export function CookieUniversalProvider({server, children}: Props) {
  const manager = useNetworkManager();

  const cookieManager = useLazyRef(() => {
    if (!server && hasDocumentCookie()) {
      return new BrowserCookieManager();
    }

    if (manager == null) {
      throw new Error(NO_MANAGER_ERROR);
    }

    return manager.cookies;
  }).current;

  return (
    
      {children}

@shopify/react-network

A collection of components that allow you to set common HTTP headers from within your React application

MIT
Latest version published 4 months ago

Package Health Score

53 / 100
Full package analysis

Similar packages