carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

wp.compose.withState is deprecated. Please use wp.element.useState instead.

Open namzzz opened this issue 3 years ago • 3 comments

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 image

namzzz avatar Aug 15 '23 10:08 namzzz

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 }; }; `

pykbb avatar Jun 11 '25 05:06 pykbb

Hi, is there any progress with this issue? We use Carbon Fields inside a plugin and users are concerned about this warning.

aleskozelsky avatar Jul 31 '25 21:07 aleskozelsky

Can we get a priority on this? It would be great to be able to ship a plugin without console logs.

jonbrockett avatar Mar 05 '26 22:03 jonbrockett