@leafygreen-ui/lib
Advanced tools
Comparing version 4.1.0 to 4.2.0
# @leafygreen-ui/lib | ||
## 4.2.0 | ||
### Minor Changes | ||
- fabc1c9: `isComponentType` function now types return-element more specifically, rather than just as `React.ReactElement` | ||
## 4.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -24,3 +24,3 @@ /// <reference types="react" /> | ||
/** Helper type to check if element is a specific React Component */ | ||
export declare function isComponentType(element: React.ReactNode, displayName: string): element is React.ReactElement; | ||
export declare function isComponentType<T = React.ReactElement>(element: React.ReactNode, displayName: string): element is T; | ||
/** Object mapping keyCodes to keys */ | ||
@@ -27,0 +27,0 @@ export declare const keyMap: { |
{ | ||
"name": "@leafygreen-ui/lib", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "leafyGreen UI Kit Internal Library", | ||
@@ -5,0 +5,0 @@ "browser": "./dist/index.web.js", |
@@ -39,6 +39,6 @@ import * as typeIs from './typeIs'; | ||
/** Helper type to check if element is a specific React Component */ | ||
export function isComponentType( | ||
export function isComponentType<T = React.ReactElement>( | ||
element: React.ReactNode, | ||
displayName: string, | ||
): element is React.ReactElement { | ||
): element is T { | ||
return ( | ||
@@ -45,0 +45,0 @@ element != null && |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216287