react-truncate-html
react-truncate-html copied to clipboard
Warning within React.StrictMode. Legacy API: String Refs
- react: 17.0.2
- react-dom: 17.0.2
- react-truncate-html: 0.1.7
Code:
<React.StrictMode>
...
<Truncate
lines={3}
dangerouslySetInnerHTML={{
__html: 'Hi, <strong>here’s some</strong> <i>HTML</i>'
}}
/>
...
</React.StrictMode>
Console out:
Warning: A string ref, "paragraph", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref
at Truncate
https://reactjs.org/link/strict-mode-string-ref
Pull request #18
Hi @jariz - Any update on this? Thx!