Reconfiguring theme issue.


I’m trying to switch between different states for the input depending on some data. But it doesn’t seem to update the styles for some reason using compartment.reconfigure(…).

Here is a Codesandbox with the code. It should switch between red/green borders on toggling error state ?

What am I doing wrong ?


I don’t really see through the React magic here well enough to say much about this. You definitely don’t want to keep generating new themes like this, since it’ll cause additional CSS to be generated on every call (just put the error and non-error theme in a variable and reuse them), but that’s not the reason the border isn’t showing up.