bsidelinger912 / shiitake

React Line clamp that won't get you fired
MIT License
100 stars 22 forks source link

Updating UI state does not result in a change of value rendered #42

Closed berziiii closed 4 years ago

berziiii commented 4 years ago

We are using v3.0.1 within a react app. When we have a state change with this version, the value in which is wrapped in the Shiitake component does not update without a resize event. Therefore, when the UI needs to change, it holds onto the old value and just appends a ... instead of re-rendering the component to determine if the new value needs to be truncated or not.

The value appears to be appended to the DOM but the original value does not update. This is not an issue in v2.3.1

image

Work around is to add a key={stateValue} to trigger a re-render of the component so when the value in the state changes, the component will adjust

bsidelinger912 commented 4 years ago

Hi @berziiii this should be fixed now with v3.0.2.

bsidelinger912 commented 4 years ago

Closing as I believe this was fixed some time ago