react18-themes
Version:
Unleash the Power of React Server Components! Use multiple themes on your site with confidence, without losing any advantages of React Server Components.
66 lines (65 loc) • 2.31 kB
TypeScript
import type { HTMLProps, ReactNode } from "react";
import type { ThemeSwitcherProps } from "../../../client";
/** @deprecated */
export type ForcedPage = {
pathMatcher: RegExp | string;
props: ThemeSwitcherProps;
};
/** @deprecated */
export interface NextJsSSRThemeSwitcherProps extends HTMLProps<HTMLElement> {
children?: ReactNode;
/** @defaultValue 'div' */
tag?: keyof JSX.IntrinsicElements;
forcedPages?: ForcedPage[];
/** id of target element to apply classes to. This is useful when you want to apply theme only to specific container. */
targetId?: string;
/** provide styles object imported from CSS/SCSS modules, if you are using CSS/SCSS modules. */
styles?: Record<string, string>;
}
/**
* @deprecated - We no longer need server side wrappers or targets.
* This component will be removed in the next release.
* @example
* ```tsx
* <NextJsSSGThemeSwitcher />
* ```
*/
export declare function NextJsSSGThemeSwitcher(props: NextJsSSRThemeSwitcherProps): import("react/jsx-runtime").JSX.Element;
/**
* @deprecated - We no longer need server side wrappers or targets.
* This component will be removed in the next release.
* @example
* ```tsx
* <NextJsSSRThemeSwitcher />
* ```
*/
export declare function NextJsSSRThemeSwitcher(props: NextJsSSRThemeSwitcherProps): import("react/jsx-runtime").JSX.Element;
/**
* @deprecated - We no longer need server side wrappers or targets.
* This component will be removed in the next release.
* @example
* ```tsx
* <NextJsServerTarget />
* ```
* For naming consistancy, clarity, and minimizing API updates */
export { NextJsSSGThemeSwitcher as NextJsServerTarget };
/** @deprecated */
export interface ServerSideWrapperProps extends NextJsSSRThemeSwitcherProps {
/** @defaultValue 'html' */
tag?: keyof JSX.IntrinsicElements;
}
/**
* @deprecated - We no longer need server side wrappers or targets.
* This component will be removed in the next release.
* Server side wrapper for Next.js to replace `html` tag
* @example
* ```tsx
* <ServerSideWrapperProps lang="en">
* <body>
* <ThemeSwitcher />
* {children}
* </body>
* </ServerSideWrapperProps>
* ```
*/
export declare function ServerSideWrapper(props: ServerSideWrapperProps): import("react/jsx-runtime").JSX.Element;