How to use the sku/react-treat.useTheme function in sku

To help you get started, we’ve selected a few sku 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 seek-oss / braid-design-system / lib / components / useToast / ToastContext.tsx View on Github external
export const useToast = () => {
  const treatTheme = useTheme();
  const addToast = useContext(ToastControllerContext);

  if (addToast === null) {
    throw new Error('No "ToastProvider" configured');
  }

  return (props: Omit) =>
    addToast({ ...props, treatTheme, id: `${toastCounter++}` });
};

sku

Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest

MIT
Latest version published 1 month ago

Package Health Score

78 / 100
Full package analysis