Skip to content

Commit

Permalink
fix: make server types more generalized
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Oct 30, 2021
1 parent a612eb6 commit 874b7f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions server/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { renderToStaticMarkup } from "react-dom/server";
*/
export function toComponent(
html: string,
styles: Styles = defaultStyles
styles: Styles<any, any> = defaultStyles
): React.ReactElement {
const { dash } = styles;
const { names, css } = createStylesFromString(html, styles);
Expand Down Expand Up @@ -69,7 +69,7 @@ export interface StyleProps {
/**
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
*/
styles?: Styles;
styles?: Styles<any, any>;
}

/**
Expand All @@ -82,7 +82,7 @@ export interface StyleProps {
* // gatsby-ssr.js
* exports.replaceRenderer = require('@dash-ui/react/server').createGatsbyRenderer()
*/
export function createGatsbyRenderer(styles: Styles = defaultStyles) {
export function createGatsbyRenderer(styles: Styles<any, any> = defaultStyles) {
/* istanbul ignore next */
return function replaceRenderer<P = any>(props: P): P {
// @ts-expect-error
Expand Down
6 changes: 3 additions & 3 deletions server/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as React from "react";
*/
export declare function toComponent(
html: string,
styles?: Styles
styles?: Styles<any, any>
): React.ReactElement;
/**
* A React component for injecting SSR CSS styles into Next.js documents
Expand Down Expand Up @@ -54,7 +54,7 @@ export interface StyleProps {
/**
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
*/
styles?: Styles;
styles?: Styles<any, any>;
}
/**
* Creates a Gatsby replaceRenderer for injecting styles generated by Dash on
Expand All @@ -67,6 +67,6 @@ export interface StyleProps {
* exports.replaceRenderer = require('@dash-ui/react/server').createGatsbyRenderer()
*/
export declare function createGatsbyRenderer(
styles?: Styles
styles?: Styles<any, any>
): <P = any>(props: P) => P;
export * from "@dash-ui/styles/server";

0 comments on commit 874b7f8

Please sign in to comment.