diff --git a/package/cpp/rnskia/values/RNSkReadonlyValue.h b/package/cpp/rnskia/values/RNSkReadonlyValue.h index f8eb5aade6..0af42cd065 100644 --- a/package/cpp/rnskia/values/RNSkReadonlyValue.h +++ b/package/cpp/rnskia/values/RNSkReadonlyValue.h @@ -11,7 +11,7 @@ #include #include "JsiSkHostObjects.h" -#include "JsiValueWrapper.h" +#include "JsiValue.h" #include "RNSkPlatformContext.h" namespace RNSkia { @@ -29,8 +29,7 @@ class RNSkReadonlyValue explicit RNSkReadonlyValue( std::shared_ptr platformContext) : JsiSkHostObject(platformContext), - _valueHolder(std::make_shared( - *platformContext->getJsRuntime())) {} + _valueHolder(std::make_shared()) {} virtual ~RNSkReadonlyValue() { invalidate(); } @@ -107,7 +106,7 @@ class RNSkReadonlyValue @param value Next value */ virtual void update(jsi::Runtime &runtime, const jsi::Value &value) { - auto equal = _valueHolder->equals(runtime, value); + auto equal = _valueHolder->operator==(RNJsi::JsiValue(runtime, value)); if (!equal) { _valueHolder->setCurrent(runtime, value); notifyListeners(runtime); @@ -127,14 +126,14 @@ class RNSkReadonlyValue Returns the current value as a jsi::Value */ jsi::Value getCurrent(jsi::Runtime &runtime) { - return _valueHolder->getCurrent(runtime); + return _valueHolder->getAsJsiValue(runtime); } /** Returns the underlying current value wrapper. This can be used to query the holder for data type and get pointers to elements in the holder. */ - std::shared_ptr getCurrent() { return _valueHolder; } + std::shared_ptr getCurrent() { return _valueHolder; } protected: /** @@ -158,7 +157,7 @@ class RNSkReadonlyValue } private: - std::shared_ptr _valueHolder; + std::shared_ptr _valueHolder; long _listenerId = 0; std::unordered_map> _listeners;