reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Stylesheet not applied after pc.redirect() or pc.link()

Open simonmesmith opened this issue 2 years ago β€’ 0 comments

Describe the bug

I apply a style sheet to my app as follows:

app = pc.App(state=BaseState, stylesheets=["style.css"])

When you first load the app on the home page, the stylesheet is applied perfectly.

If you navigate to another page of the app, then navigate back to the home page from that page via either a pc.link with href="/" or pc.redirect("/"), the stylesheet is no longer applied.

If you hit refresh in your browser, the stylesheet gets applied again.

If you use the back button instead of clicking a pc.link() or using pc.redirect(), the stylesheet is still applied.

If you use a raw link like pc.markdown("<a href='/'>Home</a>"), the stylesheet is still applied.

To Reproduce Steps to reproduce the behavior:

  • Create an app and add a stylesheet
  • Have a home page and another page
  • In my case: Load content dynamically into the home page (via a conversation with an LLM)
  • Navigate to the other page
  • Navigate back using either pc.link() or a button with a pc.redirect() on_click event

Expected behavior

  • Stylesheet should still be applied

** Specifics (please complete the following information):**

  • Python Version: 3.11.4
  • Reflex Version: ?
  • OS: Mac
  • Browser (Optional): Chrome

simonmesmith avatar Jun 30 '23 13:06 simonmesmith