Skip to content

Commit 52b0f0f

Browse files
committed
Treat empty string prop value as a valid input
1 parent 5f077a9 commit 52b0f0f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

packages/connect-react/examples/nextjs/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.0.0-preview.19",
3+
"version": "1.0.0-preview.20",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/utils/component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,11 @@ export function stringPropErrors(opts: ValidationOpts<ConfigurablePropString>):
9797
const _value = valueFromOption(opts.value)
9898

9999
if (!opts.prop.default) {
100-
if (typeof _value === "undefined" || _value == null) return [
101-
"required",
102-
]
103-
if (!String(_value).length) return [
104-
"string must not be empty",
105-
]
100+
if (typeof _value === "undefined" || _value == null) {
101+
return [
102+
"required",
103+
]
104+
}
106105
}
107106
}
108107

0 commit comments

Comments
 (0)