Skip to content

Commit

Permalink
Updated @types/react.d.ts and added new @types/react.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-murakami committed Dec 1, 2023
1 parent f158cdb commit 8f3e60f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 deletions.
31 changes: 0 additions & 31 deletions @types/react.d.ts

This file was deleted.

20 changes: 20 additions & 0 deletions @types/react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type React from 'react'
import type { SetStateAction, WeakValidationMap, ValidationMap } from 'react'

declare module 'react' {
export type SetState<S> = React.Dispatch<SetStateAction<S>>

/**
* This type of Component never return a UI.
* Only contain effect for a business logic.
*/
export interface HeadlessEffectComponent<P = any> {
(props: P, context?: any): ReactNode
contextTypes?: ValidationMap<any> | undefined
defaultProps?: Partial<P> | undefined
displayName?: string | undefined
propTypes?: WeakValidationMap<P> | undefined
}

export type HeadlessComponent<P = any> = React.FC<P>
}

0 comments on commit 8f3e60f

Please sign in to comment.