R
Refine

ask-any-question

useModalForm seems to be invalidating all data that's present on the site, is there any way around?

Ssensitive-blue8/16/2023
I'm using useModalForm to create a nested entity (say I am in the edit form of a Post and I want to create a new Category and attach the category to the Post I was editing). Everything works fine until I try to save and attach the received category.ID to my Post. As soon as I save the Category, the complete Post-Form gets reloaded. I think this might be intentional to get "the latest data", but is there a way to avoid reloading ALL of the data? In this case my Post might have lots of changes and Refine is just reloading and overwriting all fields with the "fresh" data.
Kkapa.ai8/16/2023
Hi @bastianwegge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the extracts, it seems like the behavior you're experiencing might be related to the autoResetForm property of the useModalForm hook. By default, this property is set to true, which means the form will be reset after a successful submit. If you want to prevent the form from resetting after submitting, you can set autoResetForm to false when you call useModalForm. Here's an example:
const modalForm = useModalForm({
modalProps: {
autoResetForm: false,
},
});
const modalForm = useModalForm({
modalProps: {
autoResetForm: false,
},
});
However, the extracts don't provide information specifically about updating a nested entity and preventing a reload of all data. For more detailed guidance, you might want to refer to the Refine documentation (https://refine.dev/docs) or seek help from the Refine community. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai8/16/2023
<@317433576721219584> kapa.ai is still learning and improving, please let us know how it did by reacting below
Ssensitive-blue8/16/2023
Nope that doesn't help. It's the other form that gets reloaded, which I'd like to avoid. @core maybe you have some suggestion for me? 🙂 I was actually using syncWithLocation: true, within useModalForm which caused the reload. Another one on my end 😄 ✅

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
Is it possible to use useTable without Sync?Lets say I want to use useTable for a dynamic searchForm inside of a Wizard. How would I deactivate tableProps Dependent on useShow() Attribute Causing ErrorHello, I have a 'show' page for a store that queries for its products by using a permanent on the pcypress auth0 loginHi, I am using Auth0 to log in to my app and the login page is hosted on the Auth0 website which ususeModalForm show() doesn't do anything after modal is opened and closed oncetitleSelect - Getting Label based on Foreign KeyHi! I have a resource `locationProducts`, which maps a 'locationID' to a 'productID' from another rAntd Filter Search Not VisibleHi! I'm following the Antd table documentation, which offers filterSearch. When I try adding it tSupabase dashboard access?Hello, I was looking for a quick prototyping tool for something im working on. After going through tTypeError: rawData.some is not a functionHeya everyone. I am running into an error that I've been trying to figure out for a few hours at tRefine pricingHi Refine team ! Do you provide a plan for startup ? We're working on our client dashboard and we wcreate page styleIam using Create component from refinedev/mui. I want to style the form to take full height it seemsChange logo and title in Index.html not working properlyHello everyone Like react i have changes the title and meta faviicon but only the faviicon seems toOpen other resource in new tabis there any hooks or component to embed a text to open a new tab to another show resource