I'm using React with Semantic UI which makes it really easy to not render icons in a hidden state (you just don't render the tag).
Unfortunately, sometimes the layout spacing will change when the icon is hidden / not rendered. Some examples:
1) in a small table in a row with an icon, there can be a small row height change with and without the icon tag
2) in a list item with and without a right-floated icon
3) in a narrow sortable table header with no sorting caret will be more narrow than when there is sorting causing column resizing
I think the problem is that icons are different sizes so it might be hard to generalize the hidden state for multiple icons in the same location, but assuming one icon only with shown or hidden, what is the best way to hide an icon in Semantic UI to maintain layout spacing?