React a component can display details can also be edited by the form, what is a good plan?

A modal box can display details or form editing, what"s a good solution?
just described is not very clear, we abandon the modal box, that is, in a component, you not only need to display details, but also can edit details or add forms. (because the field page is exactly the same, except that the editor has a form, but the details do not have a form)

Oct.28,2021

if you just want to implement the requirements instead of designing the components yourself, Recommend a component library for you to use Modal components in ~
to meet your needs
Link description


React UI library first recommends using
Antd has a
Modal , It's entirely possible to satisfy you.

Menu