Contentful logo

Contentful Community

Create multiple field editors under one App, using the App Framework

I’m trying to build a contentful app for multiple fields. What is the best approach to creating multiple custom fields without having to create a separate app project for each one? I was thinking of doing something like checking the field id and field type. Based on that I render the custom component. For example in the Field.tsx we might have something like:

if( === “txtEmail”){
return <MyCustomEmailField sdk={props.sdk}/>

else if( === “txtPhone”){
return <MyCustomPhoneField sdk={props.sdk}/>

Again what I’m trying to achieve is to have one app projects for multiple custom fields. I don’t want to create an app for each custom field. It might be too difficult to manage all those apps. Would the above approach work? If you see any issues with this let me know.