Message Boards

Toggling between 2 react portlets : refresh issue

Yahia Alaoui, modified 4 Years ago.

Toggling between 2 react portlets : refresh issue

New Member Posts: 4 Join Date: 1/28/20 Recent Posts
Hello, I have created 2 react portlets and adapted them to Liferay (7.2 ga1) with "yo liferay-js:adapt". Then I have added them in their respective pages. The 2 portlets shows ok. The first portlet is displayed, then when I click on the menu to go the second, the 2nd portlet is displayed correctly. The issue is when I click on the menu to get back to the first portlet, the first portlet is displayed just blank.However when I refresh the url, the portlet does show correctly.And nothing special in the log neither Liferay log, nor in the chrome log.Any idea please?
Yahia Alaoui, modified 4 Years ago.

RE: Toggling between 2 react portlets : refresh issue

New Member Posts: 4 Join Date: 1/28/20 Recent Posts
After further investigation, it seems it is related to "yo liferay-js:adapt" vs  "yo liferay-js". When I created directly a simple portlet with "yo liferay-js" then built and deployed the portlet into LR. Whenever I come back to this portlet, it shows correctly without the need to refresh.However, if I create a standard react app with "npx create-react-app my-app", then convert it to LR using "yo liferay-js:adapt", the generated portlet has the same refresh issue.Any idea?
thumbnail
Ivan Zaera, modified 4 Years ago.

RE: Toggling between 2 react portlets : refresh issue

Regular Member Posts: 119 Join Date: 10/1/13 Recent Posts
Hey Yahia:
I'm already investigating this and it looks like an issue with adaptation, so I have created this issue to have a look at it -> https://github.com/liferay/liferay-js-toolkit/issues/498
Thx for reporting it :-).