Skip to content

feat: do not allow reactive to be used as boolean#846

Merged
maartenbreddels merged 2 commits intomasterfrom
feat_disable_boolean_use_of_reactives
Dec 17, 2024
Merged

feat: do not allow reactive to be used as boolean#846
maartenbreddels merged 2 commits intomasterfrom
feat_disable_boolean_use_of_reactives

Conversation

@maartenbreddels
Copy link
Copy Markdown
Contributor

No description provided.

@maartenbreddels maartenbreddels added this to the Solara 2.0 milestone Nov 1, 2024
@maartenbreddels maartenbreddels changed the title Feat disable boolean use of reactives feat: do not allow reactive to be used as boolean Nov 1, 2024
@maartenbreddels
Copy link
Copy Markdown
Contributor Author

@Jhsmit i guess you would like this

@Jhsmit
Copy link
Copy Markdown
Contributor

Jhsmit commented Nov 4, 2024

see also #782

Copy link
Copy Markdown
Collaborator

iisakkirotko commented Dec 13, 2024

@maartenbreddels
Copy link
Copy Markdown
Contributor Author

Should we start adding a run of the unittests with this setting on? Can be a 2nd commit on this branch.

reactive_var = solara.reactive(0)
...
if reactive_var: # this is often a mistake
if reactive_var.value: # this is the correct way to check the value
@iisakkirotko iisakkirotko force-pushed the feat_disable_boolean_use_of_reactives branch from e46fa72 to 2c75ff8 Compare December 16, 2024 16:37
@maartenbreddels maartenbreddels temporarily deployed to feat_disable_boolean_use_of_reactives - solara-stable PR #846 December 16, 2024 16:37 — with Render Destroyed
@maartenbreddels
Copy link
Copy Markdown
Contributor Author

Note: this feature is not enabled by default in solara 1.x, it will be planned to be the default in 2.x and above.

@maartenbreddels maartenbreddels merged commit 66b2864 into master Dec 17, 2024
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