ratty-blush
ratty-blush6mo ago

initialValues: { initialValues numeric

What value should you set when a field in initialValues is a number and want it null
2 Replies
kapa.ai
kapa.ai6mo ago
Hi @japope. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- In the context of the initialValues property in Refine, if you want a numeric field to be null, you can simply not include that field in the initialValues object or set it to null. Here's an example:
const modalForm = useModalForm({
initialValues: {
title: "Hello World",
numericField: null,
},
});
const modalForm = useModalForm({
initialValues: {
title: "Hello World",
numericField: null,
},
});
In this example, numericField is set to null. If you want it to be undefined, you can simply not include it in the initialValues object. Please note that the actual behavior might depend on how your form and form fields are implemented. If you're using a library like Formik or Ant Design's Form, you might need to check their respective documentation for handling null and undefined values. For more information, you can refer to the Refine documentation (https://refine.dev/docs/ui-integrations/mantine/hooks/use-modal-form#initialvalues). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@465923409973477386> kapa.ai is still learning and improving, please let us know how it did by reacting below