Simple Content variant with react aplication


I have a bloomreach project with react aplication. I would like use Simple Content components for showing diferents Documents Types. Currently I duplicate Simple Content component and change it name, then I create *.tsx file with the same name in react aplication.

There is other way to do? (I prefer don’t duplicate the component)
Can I use “variant” configuration in react aplication as freemarker template?

Hi Diego, are you actually rendering different templates based on the different content types?

Hi Joeri,

Thanks for reply.

I want to render different content types with the Simple Content component. Currently, you can do it by selecting freemarker template, but I use a react application (I don’t have a freemarker templates). I want to do something look likes freemarker templates with the react application.

I solved it.

I use the document type value (contentType field) received in json resource api. Also I put a select field in document type for selecting the “template” when I have a more than one react application file for one document type. I decide the react application file by value of this field “template”.