I have successfully implemented the show more/show less. My problem is that I want to achieve it based on the number of lines or height of the screen. I don't want it to be based on number of characters since it would look bad on certain screens. like kinda cut on larger screen while too long on small screens.
Pls check my codesandbox here CLICK HERE
<DescriptionText>
{isShowMore ? text.slice(0, 300) : text}
</DescriptionText>
{text && text.length > 300 && (
<ShowMoreText onClick={toggleReadMore}>
{isShowMore ? "Show more..." : "Show less"}
</ShowMoreText>
)}

