[SOLVED] React Component not updating with file changes

I have a strange problem I cannot resolve. One of my react components does not seem to update correctly when I make changes to the file. All other files update correctly and the changes are reflected immediately in the app.

This component is used in two places. The main use is inserted into the App.jsx via Flow Router. The second use is put directly into another component’s render function.

With both uses, if I add console.log statements, they do not print to the console.

With the second use (directly placed in render) nothing is ever rendered for this component. I just have a blank space on the layout.

With the main use (Flow Router), I can make changes such as commenting out the return values from getMeteorData, but the component still renders as if I hadn’t. All data is still available and updates as designed. Even while it is updating and behaving as if I hadn’t made these changes, I can place console.log statements in ComponentWillMount and ComponentDidMount, but they never print even though the component is clearly mounting since I can see it in the layout.

Any ideas what might cause this? I’ll post code if necessary, but I’m not sure what exactly to post.

Thanks.
Ken

Have you tried running it in incognito mode in your browser, or in a different browser altogether, just to get rid of any possible caching issues?

I tried deleting the cache files directly, but no change. I’ll give incognito mode a try. Thanks.

Ken

D’oh! Newbie mistake. Without getting into the “why” this happened, I ended up with two identical components but with different file names. I had a duplicate and it was the duplicate that was being used by the app, not the original file where I was making my changes. Renamed the component so I didn’t have two components with the same name and everything started working correctly again.

Some of my react component can not update after code change, and after I modify the file name it can not update either… However, I delete the file then recreate it, it works fine… weird

1 Like

I have the same experience. Restarting Meteor updated it.