-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
mui
Version
5.x
Current Behavior
Currently, to allow properties to accept null values, it is necessary to explicitly add null
to the type
. However, the required
option already ensures that a non-null
value is provided.
In my case, I pass null
values through my form because the data is pulled directly from the database, and some columns are nullable.
At the moment, the process forces me to manually add null to the type for every field, which creates a poor developer experience (DX).
I suggest reversing the logic: make all fields nullable by default, and only fields that should not accept null values would need a not-null option.
Additionally, based on my tests, the required option still enforces a value even if the field allows null.
I would like to see a rework of the nullable logic to improve the developer experience.
Expected Behavior
No response
Steps To Reproduce
Environment
Latest everything.
Anything else?
No response