marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

Stops working when I refresh browser #306

Open paule89123 opened 3 years ago

paule89123 commented 3 years ago

Some background to the issue... I'm using React and I'm calling ElementQueries.init() from within the component that contains the divs I need to style. This works initially, but when I refresh the page, it stops working. Curiously, when I navigate to another page (causing my component to unmount) and then navigate back to the original page (causing my component to remount), it works again. (When I say it works I mean the styling gets applied).

So the issue only happens when I refresh. Any ideas what's causing this?

Also I tried calling ElementQueries.init() from my App.js file but for some reason my styling doesn't get applied when I call it from. Again, not sure why this is.

Any help would be greatly appreciated :)