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

Fix state undefined on intialization #123

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

thomasttvo
Copy link
Collaborator

@thomasttvo thomasttvo commented Nov 1, 2024

In the constructor, stuff may run and reference the state when it's still undefined. The type of this component dictates that the state is always defined, so this creates runtime issues. While we can still make the type | undefined, it's simpler to just move the state initialization to the very top.

@thomasttvo thomasttvo merged commit 1068f42 into master Nov 1, 2024
1 check passed
@thomasttvo thomasttvo deleted the thomas/fix-state-undefined branch November 1, 2024 19:40
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