Field component in form container

Hi,

I’m working on building a section where I can view and update customer information. The idea is to make this section editable when I choose to edit, but read-only otherwise.

To implement this logic and handle complex styling in both states, I decided to create a reusable component for each field and place these components inside a form container. This way, I can manage styling changes in one place without having to modify each field individually.

Here’s my current setup:

The component :

The issue I’m facing is that, since the input fields are inside components, I don’t get this section to enter a field name :

Expected:

In the component :

. I tried manually adding the name attribute, but it didn’t work.

Does this approach make sense? My goal is to build a flexible development “framework” so I can avoid editing every field when I need to make a global styling change.

Thanks for your help !

Same issue as me. Good to see I’m not alone on this:)

2 Likes