diff --git a/docs/api/react-wire.usewire.md b/docs/api/react-wire.usewire.md index 7770b02..3b4524e 100644 --- a/docs/api/react-wire.usewire.md +++ b/docs/api/react-wire.usewire.md @@ -11,7 +11,7 @@ creates and returns a new wire. ```typescript export declare function useWire( upLink: Wire | null | undefined, - initialValue?: Value | (() => Value), + initialValue?: Value | (() => Value | undefined), ): Wire; ``` @@ -20,7 +20,7 @@ export declare function useWire( | Parameter | Type | Description | | ------------ | ----------------------------------------------------------- | ------------------------------------------------------- | | upLink | Wire<Value> | null | undefined | the up-link wire to be connected to and sync value with | -| initialValue | Value | (() => Value) | initial value or initializer function | +| initialValue | Value | (() => Value | undefined) | initial value or initializer function | Returns: diff --git a/src/use-wire.ts b/src/use-wire.ts index f438d9b..aa49664 100644 --- a/src/use-wire.ts +++ b/src/use-wire.ts @@ -27,7 +27,7 @@ import { _WireImpl } from './wire.impl'; */ export function useWire( upLink: Wire | null | undefined, - initialValue?: Value | (() => Value), + initialValue?: Value | (() => Value | undefined), ): Wire { const [wire] = useState( () =>