Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve type support for .get_state #4623

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

adhami3310
Copy link
Member

from typing import assert_type

import reflex as rx


class AnotherState(rx.State): ...


class State(rx.State):
    async def hi_mom(self):
        x = await self.get_state(AnotherState)
        assert_type(x, AnotherState)

@adhami3310
Copy link
Member Author

@masenf is it fine we error here? i think it makes sense but it's a bit harsh

@masenf masenf merged commit b50b769 into main Jan 15, 2025
41 checks passed
@masenf masenf deleted the improve-type-support-for-.get_state branch January 15, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants