Skip to content

Commit

Permalink
docs: fix async Valibot string validation (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller authored Nov 10, 2023
1 parent 1925b67 commit 8b6a8b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/react/valibot/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function App() {
onChangeAsync={stringAsync([
customAsync(async (value) => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return value.includes("error");
return !value.includes("error");
}, "No 'error' allowed in first name"),
])}
children={(field) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/valibot/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function App() {
onChangeAsync={stringAsync([
customAsync(async (value) => {
await new Promise((resolve) => setTimeout(resolve, 1000))
return value.includes('error')
return !value.includes('error')
}, "No 'error' allowed in first name"),
])}
children={(field) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/valibot/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ form.provideFormContext()
const onChangeFirstName = stringAsync([
customAsync(async (value) => {
await new Promise((resolve) => setTimeout(resolve, 1000))
return value.includes('error')
return !value.includes('error')
}, "No 'error' allowed in first name"),
])
</script>
Expand Down

0 comments on commit 8b6a8b7

Please sign in to comment.