react-truncate
react-truncate copied to clipboard
Determine how many lines are generated through a component
I am importing this into a component, but I want to determine how many lines were generated to do some functionality on. Is there a way to get this within my component?
@nmagathan if you pass line
prop to Truncate
with a value >= 1, then this should result in the number of lines before truncation. If no value is passed, then you should get one line.
I am not sure if this answers your question.
@moubi , I think @nmagathan wants to get the number of lines that were generated for the input text. If I set lines
to 2
but the input length fits within the width of the container in less than 2 lines, it wouldn't be truncated.