Skip to main content
Nov 6, 2020 3:06 PM UTC
Question

SPA react component is not rendering new code (seems stuck)

Hi, I've followed a tutorial for setting up a react spa component and it's running and fetching the dialog.

However, now when i add additional classes (className) to the div it doesn't show up in the rendered html.

I see no errors in the error.log file under crx-quickstart and I get no errors in the browser. And the deploy says success.

I can see in the resource folder in ui.apps that my class is added.

 

I've also tried to recompile clientlibs...no change.

 

I've not been able to get npm start to work out, it sends me to http://localhost:3000/etc.clientlibs/spalab/clientlibs/clientlib-react/resources so i might have configured something wrong?

 

Have any of you used react? How do i debug this?

 

Thank you for any suggestions!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

prashantonkar
Level 4
Nov 9, 2020 3:03 PM UTC
Where are you adding additional classes ?
Translate
Nov 10, 2020 1:06 PM UTC
I added the classes to the div that I wanted to render from react, but I did a reinstall of my aem and now it works as it should. But I still can't get npm start to work out, it keep sending me to the empty page http://localhost:3000/etc.clientlibs/spalab/clientlibs/clientlib-react/resources .
Translate
prashantonkar
Level 4
Nov 10, 2020 1:11 PM UTC
Have you checked .env.development file? REACT_APP_ROOT should point to your home page.
Translate
Nov 10, 2020 1:38 PM UTC
Thanks, now it point me to the right page. However it is still empty
Translate
prashantonkar
Level 4
Nov 10, 2020 1:43 PM UTC
THere might be some errors in console or error.log files. Also please check if model.json call is returning content from AEM.
Translate
Nov 10, 2020 1:56 PM UTC
There was proxy issues on my end that caused it to fail and not render anything, but now it works. Thanks!
Translate