Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setProperty(T view, String propName, @Nullable Object value) {
}

@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case "changeBackgroundColor":
mViewManager.changeBackgroundColor(view, args.getString(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
: TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}


private:
class Delegate : public NativeSampleModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {}
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {

}

double getRandomNumber(jsi::Runtime &rt) override {
static_assert(
Expand All @@ -54,6 +57,7 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
}

private:
friend class NativeSampleModuleCxxSpec;
T *instance_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#ifdef ANDROID
#include <folly/dynamic.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif

namespace facebook::react {
Expand All @@ -25,9 +23,6 @@ class SampleNativeComponentState {
folly::dynamic getDynamic() const {
return {};
};
MapBuffer getMapBuffer() const {
return MapBufferBuilder::EMPTY();
};
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif

// Avoid multiple includes of OSSLibraryExampleSpec symbols
#ifndef OSSLibraryExampleSpec_H
#define OSSLibraryExampleSpec_H

#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
Expand Down Expand Up @@ -41,3 +46,4 @@ namespace facebook::react {
};
} // namespace facebook::react

#endif // OSSLibraryExampleSpec_H
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#ifdef ANDROID
#include <folly/dynamic.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif

namespace facebook::react {
Expand All @@ -25,9 +23,6 @@ class SampleNativeComponentState {
folly::dynamic getDynamic() const {
return {};
};
MapBuffer getMapBuffer() const {
return MapBufferBuilder::EMPTY();
};
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
: TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}


private:
class Delegate : public NativeSampleModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {}
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {

}

double getRandomNumber(jsi::Runtime &rt) override {
static_assert(
Expand All @@ -54,6 +57,7 @@ class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
}

private:
friend class NativeSampleModuleCxxSpec;
T *instance_;
};

Expand Down