Skip to content

Commit

Permalink
chore: simplify the type srouce of third-party lib (#683)
Browse files Browse the repository at this point in the history
* chore: simplify the type srouce of third-party lib

* chore: release v2.2.5
  • Loading branch information
unix authored Jan 22, 2022
1 parent 1bc7609 commit 29f3f6b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
7 changes: 4 additions & 3 deletions components/css-baseline/css-baseline.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react'
import React, { ReactElement } from 'react'
import useTheme from '../use-theme'
import flush from 'styled-jsx/server'
import flushToReact from 'styled-jsx/server'

export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>

const CssBaseline: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
const theme = useTheme()
Expand Down Expand Up @@ -302,7 +303,7 @@ const CssBaseline: React.FC<React.PropsWithChildren<unknown>> = ({ children }) =
}

type MemoCssBaselineComponent<P = {}> = React.NamedExoticComponent<P> & {
flush: typeof flushToReact
flush: FlushToReact
}

const MemoCssBaseline = React.memo(CssBaseline) as MemoCssBaselineComponent<
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geist-ui/core",
"version": "2.2.4",
"version": "2.2.5",
"main": "dist/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
Expand Down Expand Up @@ -87,6 +87,7 @@
"inter-ui": "^3.19.3",
"jest": "^27.0.5",
"next": "^12.0.9-canary.0",
"styled-jsx": "4.0.1",
"prettier": "^2.3.1",
"react": "^17.0.2",
"react-color": "^2.19.3",
Expand All @@ -102,8 +103,7 @@
"typescript-transform-paths": "^3.3.1"
},
"dependencies": {
"@babel/runtime": "^7.16.7",
"styled-jsx": "4.0.1"
"@babel/runtime": "^7.16.7"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand Down
15 changes: 8 additions & 7 deletions typings/styled.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
declare global {
declare module 'react' {
interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> {
jsx?: boolean;
global?: boolean;
}
// Definitions by: @types/styled-jsx <https://www.npmjs.com/package/@types/styled-jsx>

import 'react'

declare module 'react' {
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
jsx?: boolean
global?: boolean
}
}

0 comments on commit 29f3f6b

Please sign in to comment.