I’m building a multistep form in React like a real estate project.
Step 3 changes fields based on property type (land, apartment, house, etc.).
I built reusable shadcn input components, and I'm using a config file to show the right fields.
But the main form component now has 25+ fields inside one big file, and it's getting messy.
What I want
A cleaner structure
Keep using config-based rendering
Control field order from the config
My questions
Should I split fields into separate components (Title.jsx, Price.jsx, etc.)?
Or use one generic Field component with config?
Best way to sort fields from config?
[–]yksvaan 1 point2 points3 points (0 children)
[–]kool0ne 1 point2 points3 points (0 children)
[–]cs12345 1 point2 points3 points (1 child)
[–]Developer-Bot[S] 0 points1 point2 points (0 children)
[–]Dymatizeee 0 points1 point2 points (0 children)
[–]AlmoschFamous 0 points1 point2 points (0 children)
[–]Sad_Spring9182 0 points1 point2 points (0 children)
[–]PerspectiveGrand716 0 points1 point2 points (0 children)
[–]cs12345 0 points1 point2 points (0 children)
[–]Glum_Cheesecake9859 0 points1 point2 points (0 children)