-
-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
I found a way to show more text but i cannot figured out how to show less text. Once expanded, the textTruncateChild disappear.
const [expanded, setExpanded] = useState(false);
return (
<TextTruncate
line={expanded ? 2000 : props.lines}
element="span"
truncateText="…"
text={props.text}
textTruncateChild={<a onClick={() => {setExpanded(!expanded)}}>{expanded?'less': 'more'}</a>}
/>
);
Metadata
Metadata
Assignees
Labels
No labels