Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

How I can render list in react and show it on page

Avatar

Level 2

I have this

@Self
@Via(type = ResourceSuperType.class)
private List list;

 

@Override
public Collection<ListItem> getListItems() {
return null != list ? list.getListItems() : null;
}

Is that even good? 

And in react im trying to render it like this but nothing is happening, blank page

{props.listItems && (
<h4 className="footer__title">{props.listItems}</h4>
)}

Any suggestion?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Please check the page JSON format by adding model.json in the url something like this  : /content/we-retail.model.json. Search whether list is getting created in your component JSON.

Please cross check getExportedType() method is there in Model, MapTo('component-path') in React Component and same React Component is imported in import-components.js .


If all looks good, you can put loggers in react component initialization to debug more. 
React code looks fine. 
Document : https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/s...

sachinarora_0-1657627803238.png

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Please check the page JSON format by adding model.json in the url something like this  : /content/we-retail.model.json. Search whether list is getting created in your component JSON.

Please cross check getExportedType() method is there in Model, MapTo('component-path') in React Component and same React Component is imported in import-components.js .


If all looks good, you can put loggers in react component initialization to debug more. 
React code looks fine. 
Document : https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/s...

sachinarora_0-1657627803238.png