react-truncate-html icon indicating copy to clipboard operation
react-truncate-html copied to clipboard

Changing Lines does not change the component

Open mennolaan opened this issue 8 years ago • 2 comments

Im using react-truncate-html with a slider on my page where a user can define the amount of lines. However the Truncate component seems to cache the data. As the data doesn't change, only the amount of lines it doesn't update to the new amount of lines.

Is it possible to take the change in properties into account?

mennolaan avatar Nov 15 '17 12:11 mennolaan

Sure! Feel free to file a PR, this would probably be a good starting point: https://github.com/jariz/react-truncate-html/blob/master/Truncate.js#L47

jariz avatar Nov 16 '17 11:11 jariz

The line I referenced changed, see this new link: https://github.com/jariz/react-truncate-html/blob/master/Truncate.js#L52

jariz avatar Nov 20 '17 11:11 jariz