Hi,
Can anyone share a sample code which contains sightly and react js. A component which contains sightly and react js can anyone please share?
Views
Replies
Total Likes
This post is a detailed step by step guide (steps sample code et al) for integrating AEM with React JS - https://sinnerschrader.github.io/aem-react/
Naveen
Views
Replies
Total Likes
I just want to print 'Hello' in AEM page using react. I am adding the below script but it is not printing in the page. Can you please help?
<script>
React.render("hello", document.getElementById("app"));
</script>
Views
Replies
Total Likes
The below code I have in sightly component, it is not printing "hello world" in the page. Can anyone please suggest??
<script>
var element = <h1>Hello, world</h1>;
ReactDOM.render(
element,
document.getElementById('root')
);
</script>
<div id="root"></div>
hello
Views
Replies
Total Likes
Do you have console errors?
Views
Replies
Total Likes
yes I am getting console errors. Can you share a sample code which uses react js in AEM?
Views
Replies
Total Likes
If I put the below code in /etc I get the error 'ReactDOM' is not defined. Do anyone know what to do?
ReactDOM.render(React.createElement('div', null, 'Hello from Kode'), document.getElementById('react-target'));
Views
Replies
Total Likes
The above code works, but I am getting errors 'import' and '<' for react in AEM. How to use react in AEM??
Views
Replies
Total Likes
Views
Likes
Replies