vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
849 stars 335 forks source link

Handling warning to rename componentWillMount to UNSAFE_componentWill… #211

Open GustavoBenevenuto opened 2 years ago

GustavoBenevenuto commented 2 years ago

Handling warning to rename componentWillMount to UNSAFE_componentWillMount, and componentWillReceiveProps to UNSAFE_componentWillReceiveProps.

Log WARN

 LOG  Running "RN-APP" with {"rootTag":1}
 WARN  Warning: componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: SvgUri
 WARN  Warning: componentWillReceiveProps has been renamed, and is not recommended for use. 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
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: SvgUri
saikiran-chatti commented 6 months ago

Hi, did you find any resolution for this ?