react-truncate icon indicating copy to clipboard operation
react-truncate copied to clipboard

Truncate get error on 'width' prop when my app still work in another tab like keep-alive component

Open Sindr0me opened this issue 3 years ago • 0 comments

Hi, im working with iframe in tabs in my app. Every iframe is a separately react app. So I have a problem that when I leave from my tab with truncates components like that to another tab

          <Truncate
            onTruncate={param => {
              setTooltip(param);
            }}
            lines={truncateRows || 1}
            width={truncateOnWidth || 0}
            className="truncate-cell"
          >
            {value && value}
          </Truncate>

My app still works and has crashed with an error like this when the component has rerendered with newly uploaded data

Uncaught Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "webpack-internal:///./node_modules/react-truncate/lib/Truncate.js", lineNumber: 182, columnNumber: 0, data: null,

It's wrong only with prop 'width', If it prop have a value, the app will be crushed. So, I really confused about it.

p.s. my truncate cells will rerender sometimes because the new data can be uploaded anytime

Sindr0me avatar Aug 13 '20 16:08 Sindr0me