react-truncate
react-truncate copied to clipboard
Does not collapse on initial page load even though expanded is set to false
UPDATE I realized its the same issue as mentioned here https://github.com/One-com/react-show-more/issues/10 Even if I dont integrate with the react-show-more the element starts off fully rendered, then reduces its height to be truncated. Is there any fix for this? How have other people handled this?
I handled this by setting an initial text state to '...', then in componentDidMount(), set it to props.children. There will be a flash of content, but at least it's better than showing the entire text initially. https://www.webpackbin.com/bins/-L4HvObkgDRAzFxBHYO8