Skip to content
Discussion options

You must be logged in to vote

Overview

a20f0bf
I was also looking into the issue above. In conclusion, it’s a bug that occurs because the state_cls variable is being reused in the Redis interface class. Refer to the corresponding commit and apply the fix yourself, or wait for the latest version.

Reproduce

if there are references to another State and that referenced State ends up at the end of the array due to alphabetical ordering, an error will occur.

import reflex as rx


class AState(rx.State):
    opened: bool = False
    counter: int = 0

    @rx.event
    def toggle(self):
        self.opened = not self.opened
        self.counter += 1


class BState(rx.State):
    @rx.var
    async def greeting(self) -> str:
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by masenf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants