Describe the bug
The State __init_subclass__ path depends on get_config. So the config itself is unable to actually import any State classes, which makes it impossible to express any dynamic state vars passed to plugins, like RadixThemesPlugin.
To Reproduce
In rxconfig.py:
class State(rx.State):
...
Expected behavior
User should be able to define and/or import State classes in the rxconfig.py for the purposes of dynamic configuration.
Alternatively, if there was a way to define config and plugins outside of an importable module, that might be better and more forward looking.
For example, if the config defined some kind of __post_init__ callback, then dynamic configuration could be deferred until the config object actually existed. And it would allow mostly static (toml) config, while still providing a hook for running python code after the static config is loaded.
Specifics (please complete the following information):
- Python Version: 3.10+
- Reflex Version: 0.9.3+
- OS: any
Describe the bug
The State
__init_subclass__path depends onget_config. So the config itself is unable to actually import any State classes, which makes it impossible to express any dynamic state vars passed to plugins, likeRadixThemesPlugin.To Reproduce
In
rxconfig.py:Expected behavior
User should be able to define and/or import State classes in the rxconfig.py for the purposes of dynamic configuration.
Alternatively, if there was a way to define config and plugins outside of an importable module, that might be better and more forward looking.
For example, if the config defined some kind of
__post_init__callback, then dynamic configuration could be deferred until the config object actually existed. And it would allow mostly static (toml) config, while still providing a hook for running python code after the static config is loaded.Specifics (please complete the following information):