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

[ENG-3476]Setting State Vars that are not defined should raise an error #4007

Merged
merged 12 commits into from
Oct 3, 2024

Conversation

ElijahAhianyo
Copy link
Collaborator

@ElijahAhianyo ElijahAhianyo commented Sep 26, 2024

import reflex as rx

class State(rx.State):
   value: int = 0
   def change_value(self):
       self.value = 10 # valid
       self.num = 5   # error
       self._num = 10 # error
       self.__num = 10 # valid

@ElijahAhianyo ElijahAhianyo changed the title Setting State Vars that are not defined should raise an error [ENG-3476]Setting State Vars that are not defined should raise an error Sep 26, 2024
Copy link

linear bot commented Sep 26, 2024

@ElijahAhianyo ElijahAhianyo force-pushed the elijah-state-var-without-decalaration branch from 1adf4ca to 6a044de Compare September 26, 2024 11:33
@ElijahAhianyo ElijahAhianyo marked this pull request as ready for review September 26, 2024 15:19
@ElijahAhianyo ElijahAhianyo marked this pull request as draft September 26, 2024 15:48
@ElijahAhianyo ElijahAhianyo marked this pull request as ready for review September 26, 2024 17:30
reflex/state.py Outdated Show resolved Hide resolved
@ElijahAhianyo ElijahAhianyo force-pushed the elijah-state-var-without-decalaration branch from 5bed739 to cd91136 Compare October 2, 2024 17:29
Lendemor
Lendemor previously approved these changes Oct 3, 2024
reflex/state.py Outdated Show resolved Hide resolved
@picklelo picklelo merged commit 4b3d056 into main Oct 3, 2024
39 checks passed
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.

3 participants