@yamada-ui/utils
Advanced tools
Comparing version 1.0.2 to 1.0.3-dev-20240115161423
@@ -319,5 +319,6 @@ "use strict"; | ||
errorMessage = "useContext: `context` is undefined. Seems you forgot to wrap component within the Provider", | ||
name | ||
name, | ||
defaultValue | ||
} = {}) => { | ||
const Context = React.createContext(void 0); | ||
const Context = React.createContext(defaultValue); | ||
Context.displayName = name; | ||
@@ -324,0 +325,0 @@ const useContext2 = () => { |
@@ -14,9 +14,10 @@ import * as React from 'react'; | ||
type MaybeRenderProp<Y> = React.ReactNode | ((props: Y) => React.ReactNode); | ||
type Options = { | ||
type Options<ContextType extends any = any> = { | ||
strict?: boolean; | ||
errorMessage?: string; | ||
name?: string; | ||
defaultValue?: ContextType; | ||
}; | ||
type CreateContextReturn<T> = [React.Provider<T>, () => T, React.Context<T>]; | ||
declare const createContext: <ContextType extends unknown = any>({ strict, errorMessage, name, }?: Options) => CreateContextReturn<ContextType>; | ||
declare const createContext: <ContextType extends unknown = any>({ strict, errorMessage, name, defaultValue, }?: Options<ContextType>) => CreateContextReturn<ContextType>; | ||
declare const useSafeLayoutEffect: typeof React.useLayoutEffect; | ||
@@ -23,0 +24,0 @@ declare const useUnmountEffect: (callback: () => void) => void; |
@@ -66,5 +66,6 @@ "use strict"; | ||
errorMessage = "useContext: `context` is undefined. Seems you forgot to wrap component within the Provider", | ||
name | ||
name, | ||
defaultValue | ||
} = {}) => { | ||
const Context = React.createContext(void 0); | ||
const Context = React.createContext(defaultValue); | ||
Context.displayName = name; | ||
@@ -71,0 +72,0 @@ const useContext2 = () => { |
{ | ||
"name": "@yamada-ui/utils", | ||
"version": "1.0.2", | ||
"version": "1.0.3-dev-20240115161423", | ||
"description": "Yamada UI utils", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
326555
3858
1