diff --git a/packages/connect-react/CHANGELOG.md b/packages/connect-react/CHANGELOG.md index 4c9ed77039580..71c3730977be6 100644 --- a/packages/connect-react/CHANGELOG.md +++ b/packages/connect-react/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +# [1.0.0-preview.20] - 2025-01-16 + +- Check if a string prop is set instead of inspecting the contents of the string + # [1.0.0-preview.15] - 2024-12-18 - Emit dynamic props via `onUpdateDynamicProps` diff --git a/packages/connect-react/examples/nextjs/package-lock.json b/packages/connect-react/examples/nextjs/package-lock.json index 26d7a03f4680b..f175221cd4da7 100644 --- a/packages/connect-react/examples/nextjs/package-lock.json +++ b/packages/connect-react/examples/nextjs/package-lock.json @@ -566,9 +566,9 @@ "link": true }, "node_modules/@pipedream/sdk": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@pipedream/sdk/-/sdk-1.1.4.tgz", - "integrity": "sha512-Xjozgk/uhUyz+3h8OHXNUTaEDik1Y4kzDPmlfjeHqimwyLmY+QuRVsQCqvs4VZBSCt4fhzQt197O1aqFE+5E2g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@pipedream/sdk/-/sdk-1.1.5.tgz", + "integrity": "sha512-q+dGMsNSvIcDCi6JZES7pwNBW8Ms318WMNavO71Cye0bCtloeDSj5TiFbScy64/2FHja9keKAZ9ev8yVSsM+ew==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@rails/actioncable": "^8.0.0", diff --git a/packages/connect-react/package.json b/packages/connect-react/package.json index 4c3e17869e8a0..9ef4b1a8dff0f 100644 --- a/packages/connect-react/package.json +++ b/packages/connect-react/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/connect-react", - "version": "1.0.0-preview.19", + "version": "1.0.0-preview.20", "description": "Pipedream Connect library for React", "files": [ "dist" diff --git a/packages/connect-react/src/utils/component.ts b/packages/connect-react/src/utils/component.ts index f2d5d45b329a4..1f1ad30f39e08 100644 --- a/packages/connect-react/src/utils/component.ts +++ b/packages/connect-react/src/utils/component.ts @@ -94,16 +94,13 @@ export function integerPropErrors(opts: ValidationOpts) } export function stringPropErrors(opts: ValidationOpts): string[] | undefined { - const _value = valueFromOption(opts.value) + const { + prop, value: valueOpt, + } = opts - if (!opts.prop.default) { - if (typeof _value === "undefined" || _value == null) return [ - "required", - ] - if (!String(_value).length) return [ - "string must not be empty", - ] - } + if (!prop.default && (valueOpt == null || typeof value === "undefined")) return [ + "required", + ] } type AppWithExtractedCustomFields = App & {