deprecate state arg in App() (#2237)
This commit is contained in:
parent
4ada79c1e5
commit
1109f8f508
@ -161,11 +161,12 @@ class App(Base):
|
|||||||
"rx.BaseState cannot be subclassed multiple times. use rx.State instead"
|
"rx.BaseState cannot be subclassed multiple times. use rx.State instead"
|
||||||
)
|
)
|
||||||
|
|
||||||
# verify that provided state is valid
|
if "state" in kwargs:
|
||||||
if self.state and self.state is not State:
|
console.deprecate(
|
||||||
console.warn(
|
feature_name="`state` argument for App()",
|
||||||
f"Using substate ({self.state.__name__}) as root state in `rx.App` is currently not supported."
|
reason="due to all `rx.State` subclasses being inferred.",
|
||||||
f" Defaulting to root state: ({State.__name__})"
|
deprecation_version="0.3.5",
|
||||||
|
removal_version="0.4.0",
|
||||||
)
|
)
|
||||||
self.state = State
|
self.state = State
|
||||||
# Get the config
|
# Get the config
|
||||||
|
Loading…
Reference in New Issue
Block a user