Replies: 1 comment
-
Phind suggests: The icon name is not updating because it is being set based on a ternary operator that checks the value of state.className.collapsed. When state.className.collapsed changes, the ternary operator will re-evaluate and set the icon name to either 'eye' or 'eye_off' accordingly. However, the Icon component itself is not being re-rendered when this happens. <Icon
name={createMemo(() => state.className.collapsed ? 'eye' : 'eye_off')}
onClick={() => {
state.className.collapsed = !state.className.collapsed;
}}
size="s"
/> Doesn't really make sense to me yet... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm not sure what I'm doing wrong here, but I would like to use a POJO for state management using createMutable. In this example, I would like to update the Icon name attribute dynamically, and re-render whenever the property changes; e.g.
However, the name attribute doesn't get updated inside the Icon component. What am I doing wrong here?
Beta Was this translation helpful? Give feedback.
All reactions