patrik-piskay / react-truncate-markup

✂️ React component for truncating JSX markup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UNSAFE_componentWillReceiveProps warning with react 18

bonesoul opened this issue · comments

next-dev.js?3515:25 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: TruncateMarkup

@patrik-piskay do you have any plans to refactor the code so we can use it with React@18 strict mode? 🤔

@patrik-piskay I would appreciate it if you could move the code under componentDidUpdate 🪄