wp.compose.withState is deprecated. Please use wp.element.useState instead.
Version
- Carbon Fields: 3.5.1
- WordPress: 6,3
- PHP: 8.0
Expected Behavior
Without warning
Actual Behavior
There is a warning in console @ Plugins page on admin side
Hi, I noticed that Carbon Fields’ vendor.min.js still uses the deprecated wp.compose.withState, which causes console warnings in WordPress 5.8+.
Can we convert these usages to the modern useState hook from wp.element?
Example replacement:
`import { useState } from '@wordpress/element';
const MyComponent = () => { const [count, setCount] = useState(0); return <button onClick={() => setCount(count + 1)}>{ count }; }; `
Hi, is there any progress with this issue? We use Carbon Fields inside a plugin and users are concerned about this warning.
Can we get a priority on this? It would be great to be able to ship a plugin without console logs.