How to use the @shopify/react-html.useHtmlAttributes function in @shopify/react-html

To help you get started, we’ve selected a few @shopify/react-html 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-self-serializers / src / I18n.tsx View on Github external
const [serialized, Serialize] = useSerialized('i18n');

  const i18nDetails: I18nDetails = {
    locale: givenI18nDetails.fallbackLocale || 'en',
    ...givenI18nDetails,
    ...(serialized ? serialized.i18nDetails : {}),
  };

  const manager = useRef(
    new I18nManager(
      i18nDetails,
      serialized ? serialized.translations : undefined,
    ),
  );

  useHtmlAttributes({lang: i18nDetails.locale});

  return (
    <>
      
        {children}
      
       {
          const getData = () => ({
            translations: manager.current.extract(),
            i18nDetails,
          });

          if (manager.current.loading) {
            return manager.current.resolve().then(getData);
          }
github Shopify / quilt / packages / react-i18n-universal-provider / src / I18nUniversalProvider.tsx View on Github external
const i18nDetails: I18nDetails = {
    locale: explicitI18nDetails.fallbackLocale || 'en',
    ...(serialized ? serialized : {}),
    ...explicitI18nDetails,
  };

  const manager = useLazyRef(
    () =>
      new I18nManager(
        i18nDetails,
        serialized ? serialized.translations : undefined,
      ),
  ).current;

  useHtmlAttributes({lang: i18nDetails.locale});

  const {onError, ...primitiveI18nDetails} = i18nDetails;

  return (
    <>
      {children}
       {
          const getData = () => ({
            translations: manager.extract(),
            ...primitiveI18nDetails,
          });

          if (manager.loading) {
            return manager.resolve().then(getData);
          }

@shopify/react-html

A component to render your React app with no static HTML

MIT
Latest version published 4 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages