You can use ref.onStateChange inside content JS when using the React SDK, but this feature isn't provided for the other SDKs. This is an important feature when using content JS inside of complex symbols.
For cross-compatibility and functionality, it would be great if we could add ref.onStateChange to other SDKs, especially the upcoming v2 SDKs in Mitosis.