Usage Example:
import SwaggerUI from "swagger-ui-react";
<SwaggerUI spec={doc.openApiSpec!} docExpansion={"none"} key={doc._id!} />
Getting the following warnings in the browser console:
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-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://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.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: Connect(r)
Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.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: Connect(r)
Please update lifecycle methods to use UNSAFE keyword.
The version of react they depend on was published 2 years ago, long before those methods became deprecated
Seeing a slightly different warning while testing components that import swagger-ui-react:
componentWillReceiveProps:
Please update the following components: Connect(r), Provider
componentWillUpdate:
Please update the following components: Connect(r)
So they forgot about React?
Any update on this?
Bump
Most helpful comment
Bump