Skip to content

Commit 874b7f8

Browse files
committed
fix: make server types more generalized
1 parent a612eb6 commit 874b7f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

server/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { renderToStaticMarkup } from "react-dom/server";
1414
*/
1515
export function toComponent(
1616
html: string,
17-
styles: Styles = defaultStyles
17+
styles: Styles<any, any> = defaultStyles
1818
): React.ReactElement {
1919
const { dash } = styles;
2020
const { names, css } = createStylesFromString(html, styles);
@@ -69,7 +69,7 @@ export interface StyleProps {
6969
/**
7070
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
7171
*/
72-
styles?: Styles;
72+
styles?: Styles<any, any>;
7373
}
7474

7575
/**
@@ -82,7 +82,7 @@ export interface StyleProps {
8282
* // gatsby-ssr.js
8383
* exports.replaceRenderer = require('@dash-ui/react/server').createGatsbyRenderer()
8484
*/
85-
export function createGatsbyRenderer(styles: Styles = defaultStyles) {
85+
export function createGatsbyRenderer(styles: Styles<any, any> = defaultStyles) {
8686
/* istanbul ignore next */
8787
return function replaceRenderer<P = any>(props: P): P {
8888
// @ts-expect-error

server/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as React from "react";
1010
*/
1111
export declare function toComponent(
1212
html: string,
13-
styles?: Styles
13+
styles?: Styles<any, any>
1414
): React.ReactElement;
1515
/**
1616
* A React component for injecting SSR CSS styles into Next.js documents
@@ -54,7 +54,7 @@ export interface StyleProps {
5454
/**
5555
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
5656
*/
57-
styles?: Styles;
57+
styles?: Styles<any, any>;
5858
}
5959
/**
6060
* Creates a Gatsby replaceRenderer for injecting styles generated by Dash on
@@ -67,6 +67,6 @@ export interface StyleProps {
6767
* exports.replaceRenderer = require('@dash-ui/react/server').createGatsbyRenderer()
6868
*/
6969
export declare function createGatsbyRenderer(
70-
styles?: Styles
70+
styles?: Styles<any, any>
7171
): <P = any>(props: P) => P;
7272
export * from "@dash-ui/styles/server";

0 commit comments

Comments
 (0)