$ref Support for Database or Callback Integration
#4406 opened on Dec 2, 2024
Description
Prerequisites
- I have read the documentation
What theme are you using?
mui
Is your feature request related to a problem? Please describe.
My application is built with Supabase, and some of the enum fields need to be fetched dynamically from database tables. As far as I know, there isn't a straightforward or out-of-the-box solution for this. Based on my understanding of the documentation, the $ref expects to be linked to a property within the definition object.
If support for either callbacks or external sources (e.g., databases) could be added, it would significantly enhance the versatility, developer experience (DX), and overall ease of use of this library.
Describe the solution you'd like
A solution could include a new valueGetter property that supports an asynchronous function to fetch relevant data. The returned array/value from this function would automatically set the fetched data as the value/enum to be consumed and dynamically manage the loading state.
Describe alternatives you've considered
An inefficient workaround that requires writing a lot of code to iterate through fields, handle specific ones, and implement custom widgets. In other words, adding unnecessary complexity and excessive code just to achieve this very important feature that is needed for most modern applications.