I’m working on my first Meteor app, and I’m using both React and flow-router/react-layout for a multi-page application, as well as jquery-ui. This is my first JS-based app, so a good learning curve is involved for me.
On one of my pages, I have a query-ui accordion. In this component, I use componentDidMount to execute the jquery-ui required code,
$("#accordion").accordion();. This then modifies the elements in the DOM, adding CSS classes.
When I navigate to this page from the home page, the accordion looks like it should. However, if I reload this page, then it does not; the CSS classes have not been added. The componentDidMount method does not trigger to modify the elements. I have to navigate back to the home page, then back, and it again looks correct, and have the expected CSS classes.
With my limited understanding, it seems that when I do a browser reload, the page is being rendered in a manor that prevents the componentDidMount method to trigger.
I’d appreciate any help anyone can provide. Thanks.