next-yak
Version:
next-yak is a CSS-in-JS solution tailored for Next.js that seamlessly combines the expressive power of styled-components syntax with efficient build-time extraction of CSS using Next.js's built-in CSS configuration
17 lines (15 loc) • 639 B
JavaScript
import React, { cache, use } from "react";
import { YakThemeProvider as YakThemeProvider$1 } from "./index.js";
import { getYakThemeContext } from "next-yak/context/baseContext";
//#region runtime/context/index.server.tsx
const getYakContext = cache(() => getYakThemeContext());
const useTheme = () => {
const theme = getYakContext();
return theme instanceof Promise ? use(theme) : theme;
};
const YakThemeProvider = ({ children }) => {
return /* @__PURE__ */ React.createElement(YakThemeProvider$1, { theme: getYakContext() }, children);
};
//#endregion
export { YakThemeProvider, useTheme };
//# sourceMappingURL=index.server.js.map