How to write forms component using React? | Community
Skip to main content

2 replies

Avinash_Gupta_
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 16, 2022

Hi @davidzhang 

 

Would you please provide more details about the use case you want to implement. Refer to the following link if your ask was only to create a form in React.js 

 

https://reactjs.org/docs/forms.html 

 

Level 4
December 16, 2022

I mean how to use React in AEM Forms addon. I didn't see any example on how to integrate AEM forms component to React.

Avinash_Gupta_
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 17, 2022

Hi @davidzhang 

 

For implementing it for the AEM forms also, it would follow the similar approach to create React SPA component in AEM. You only have to assign it under the similar component group name as "Adaptive Form"  so that this component would be listed to drag drop on the forms. 

 

 

 

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/spa-editor/react/overview.html?lang=en 

 

Hope this helps.

Mayank_Gandhi
Adobe Employee
Adobe Employee
December 19, 2022

@davidzhang form has not been tested with react components unlike AEM which has SPA support. There is something in pipe line to bring it closer to aem core component on Cloud, are you using on prem?

Mayank_Gandhi
Adobe Employee
Adobe Employee
December 19, 2022

@avinash_gupta_ @davidzhang the core essence of the OOTB form components is its data binding capabilities, do keep in mind once you bring REACT components the data handling, DOR, sign, and FDM would not understand your custom component though you may have  UX then you need to handle the custom component data capture capability and merge to the form data on your own.

Level 4
December 19, 2022

Got it. What's FDM?