Fix deprecated componentWillReceiveProps lifecycle method usage in ResizableBox component #16950
Labels
[Package] Components
/packages/components
[Type] Bug
An existing feature does not function as intended
Describe the bug
The
ResizableBox
component in@wordpress/components
is throwing a React Strict warning when it is implemented:Console Error
Warning: Unsafe lifecycle methods were found within a strict-mode tree: in StrictMode (created by Editor) in Editor in Unknown (created by WithSelect(Editor)) in WithSelect(Editor)componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Resizable
I traced the warning all the way to the implementation of the re-resizable package:
https://github.com/bokuweb/re-resizable/blob/7ea154470567735149d5e3827cc9fb856f8e8f68/src/index.tsx#L463-L465
Unfortunately, this package does not have a newer release fixing the issue (GB is using the latest version), so I've opened an issue in their repository: bokuweb/re-resizable#504. There's some uncertainty on how active that package is so we'll have to see what happens.
The text was updated successfully, but these errors were encountered: