-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning when using null value on TextInput #7782
Comments
Thanks for your for submitting this. We have been able to reproduce those warnings. |
Hi I would like to solve this issue .Can I try it? |
@winniecarole Of course! We gladly accept PRs 🙂 . Just make sure to read the contribution guidelines if you haven't already 😉 |
thank |
Maybe someone else should take this bug? |
Taking some time to come back on this issue, I noticed that if your dataProvider returns |
Just one other thought on this:
May I suggest that this is dealt with on react-admin input level ( |
While I understand this reasoning, this leads to major headaches for some users though. Our API returns a lot of Is there any reason not to treat a Maybe we could have a prop on the If a change in the default behavior of those components is acceptable, I would consider working on a PR for this. WDYT? |
In the meantime we are using custom wrapper components like this to work around the problem:
|
For information I have added back the |
We're re-adding |
What you were expecting:
When my API returns
null
as the value for a<TextInput />
, it should not lead to any warnings.What happened instead:
When a record is returned by the API with a value of
null
, this leads to a warning when used on a text input:and
Steps to reproduce:
should not be null
)Related code:
https://codesandbox.io/s/hopeful-worker-u1dxlq?file=/src/posts/PostEdit.tsx
Other information:
defaultValue
of the input, ordefaultValues
of the form to an empty string (''
), doesn't make the warning go awaynull
values are treated by react-form-hook compared to react-final-form. But it's unclear to me how to mitigate this warning.Environment
The text was updated successfully, but these errors were encountered: