I'm using react clamp https://www.npmjs.com/package/react-clamp which uses clamp.js behind the scenes.
this.props.events.map((event,i) => {
return <div key={i}>
<Clamp clamp={2}>The is a really long event name</Clamp>
</div>
})
This works great if this.props.events is statically set, but these events are fetched asynchronously, and the events get rendered in when they load. For some reason, Clamp does not get reapplied. Could this have something to do with event listeners not getting bound correctly on the 2nd render?
Update Looking through the code, it renders the element with no changes, and doesn't apply clamp until componentDidUpdate is called. When I use clamp on an element that gets it's props statically, componentDidUpdate is called (though I'm not sure why, since I don't see any reason why the element would be getting updated. When the data comes through redux, componentDidUpdate is never called, therefore clamp is not applied. Could this have to do with react-redux implementing componentShouldUpdate?