Closed jshaffstall closed 1 day ago
Feels like it should work.
a slight design floor in our current implementation, so i'll need to think a little bit more about this
The issue is that if the key is not in the dictionary, then the current implementation can't track changes to that key
But it definitely should work Will need to see how they do this in solid signals But it won't be such a quick fix
For now I'd say pre populate the dictionary with None or a sentinel
Will do. Appreciate you taking a look at it.
Nice! It even works as sub-dictionaries are added by code.
Describe the bug
I'm creating a reactive class that contains an empty dictionary (the same behavior happens if the dictionary has items in it). I then have a render_effect function that uses that dictionary but with a key that doesn't exist. The thought is that there's optional information that may be added to the dictionary later.
The render_effect function looks something like this:
I then have a button that adds in the optional information:
But the render_effect function is never called. If the dictionary in the reactive class contains an initial value for the key, then everything works the way it should.
For all I know this might be the intended behavior, and reactive doesn't support adding new items to the dictionary later. But I figured it was worth checking to see if that's the case.
Version
The current main branch of reactive.
To Reproduce
Using https://anvil.works/build#clone:PO7DRW24EONBDSVQ=TQY5KSQ5R537SNJPGCSSDUJG click on the button. The label text should change, but does not.