mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
Add Windows support (#1632)
Adds Windows support. Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com> Co-authored-by: REDMOND\agnel <agnel@microsoft.com>
This commit is contained in:
committed by
Wojciech Lewicki
parent
4d3c521a22
commit
28d51bdf06
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "JSValue.h"
|
||||
#include "NativeModules.h"
|
||||
|
||||
using namespace winrt::Microsoft::ReactNative;
|
||||
|
||||
namespace winrt::RNSVG
|
||||
{
|
||||
REACT_MODULE(RNSVGModule, L"RNSVG")
|
||||
struct RNSVGModule
|
||||
{
|
||||
// See https://microsoft.github.io/react-native-windows/docs/native-modules for details on writing native modules
|
||||
|
||||
REACT_INIT(Initialize)
|
||||
void Initialize(ReactContext const &reactContext) noexcept
|
||||
{
|
||||
m_reactContext = reactContext;
|
||||
}
|
||||
|
||||
REACT_METHOD(sampleMethod)
|
||||
void
|
||||
sampleMethod(std::string stringArgument, int numberArgument, std::function<void(std::string)> &&callback) noexcept
|
||||
{
|
||||
// TODO: Implement some actually useful functionality
|
||||
callback("Received numberArgument: " + std::to_string(numberArgument) + " stringArgument: " + stringArgument);
|
||||
}
|
||||
|
||||
private:
|
||||
ReactContext m_reactContext{nullptr};
|
||||
};
|
||||
|
||||
} // namespace winrt::RNSVG
|
||||
Reference in New Issue
Block a user