question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RA v4 blocks validation due to empty array

See original GitHub issue

What you were expecting: Before RA v4, returning an empty array from the validator meant that RA treated the form as being valid. After the new update it seems that this is no longer the case, and we get a popup saying that form isn’t valid.

Not sure if this is a bug, or if it’s new behaviour that needs to be documented.

You can test this out here

You can enter some text into the array field.

If the value is less than 2 characters, it will add an array to the backlinks’ error array. if it’s larger, then it’ll just return the empty array.

What do you suggest, is this a bug or just a change in behaviour?

What happened instead:

Steps to reproduce:

Related code:

insert short code snippets here

Other information:

Environment

  • React-admin version:
  • Last version that did not exhibit the issue (if applicable):
  • React version:
  • Browser:
  • Stack trace (in case of a JS error):

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
WiXSLcommented, Apr 8, 2022

@fzaninotto, I don’t think @andrico1234 read it anywhere, he is just implying that react-final-form allowed this “undocumented” behavior, and now react-admin v4 doesn’t.

0reactions
fzaninottocommented, Apr 8, 2022

OK, I didn’t manage to do it in 5 minutes, so I’ll let it open for anyone willing to try. The solution probably comes from https://github.com/lodash/lodash/issues/2240.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Joi array validation: allow empty array
No, it doesn't require any item. You can use an empty array. If you want at least one item to be present, you...
Read more >
2023 Toyota RAV4 for Sale in Lewiston, ID
Visit Rogers Toyota of Lewiston to see the 2023 Toyota RAV4 for sale in Lewiston, ID, near Clarkston, WA, up close and personal....
Read more >
2019 Toyota RAV4 Problems: An Overall Reliable SUV ...
2019 RAV4 has had several problems such as recalls, odd shifting behavior, trouble with fuel levels, and a nagging fuel pump issue.
Read more >
2023 Toyota RAV4 Prime for Sale in Hermiston, OR
Visit Rogers Toyota of Hermiston to see the 2023 Toyota RAV4 Prime for sale in Hermiston, OR, near Pendleton, OR, up close and...
Read more >
New RAV4 Cars for Sale in Tampa Bay FL
we want to offer you a special Incentive. $25 VISA® REWARD CARD Test Drive Req'd - No Purchase Necessary. Get Offer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found