patrik-piskay / react-truncate-markup

✂️ React component for truncating JSX markup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue when content is number.

nikeshmhr opened this issue · comments

Describe the bug
When the content to truncate is number an error occurs.

To Reproduce

<TruncateMarkup lines={1} ...>
  <div>
    {1}
  </div>
</TruncateMarkup>

Here's the code sandbox https://codesandbox.io/s/react-truncate-markup-issue-4xgwc?file=/src/App.js

Screenshot from 2021-05-18 15-47-23

Thanks for reporting @nikeshmhr. We need to check for the number type here. Would you like to create a PR with the fix?

Yeah, sure I'll create PR. Thanks @patrik-piskay