Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/native-modules-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Native Modules (Advanced)

>**This documentation and the underlying platform code is a work in progress.**
>**Examples (C# and C++/WinRT):**
> - [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples/NativeModuleSample)
> - [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples-old/NativeModuleSample)
> - [Sample App in `microsoft/react-native-windows/packages/microsoft-reactnative-sampleapps`](https://github.com/microsoft/react-native-windows/tree/main/packages/sample-apps)

## Writing Native Modules without using Attributes (C#)
Expand Down
6 changes: 3 additions & 3 deletions docs/native-modules-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A common scenario for [Native Modules](native-modules.md) is to call one or more

This document proposes some best patterns to follow when bridging asynchronous methods from JS to native code for React Native Windows. It assumes you've already familiar with the basics of setting up and writing [Native Modules](native-modules.md).

> The complete source for the examples below are provided within the [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples/NativeModuleSample).
> The complete source for the examples below are provided within the [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples-old/NativeModuleSample).

## Writing Native Modules that call Asynchronous Windows APIs

Expand Down Expand Up @@ -119,7 +119,7 @@ as well as store the status code and update the return statement from `return co

But wait, we've only discussed the success path, what happens if `GetHttpResponse` doesn't succeed? We don't handle any exceptions in this example. If an exception is thrown, how do we marshal an error back to JavaScript? That is actually taken care of for you by the framework: any exception in the task will be marshaled to the JavaScript side as a JavaScript exception.

That's it! If you want to see the complete `SimpleHttpModule`, see [`AsyncMethodExamples.cs`](https://github.com/microsoft/react-native-windows-samples/blob/main/samples/NativeModuleSample/csharp/windows/NativeModuleSample/AsyncMethodExamples.cs).
That's it! If you want to see the complete `SimpleHttpModule`, see [`AsyncMethodExamples.cs`](https://github.com/microsoft/react-native-windows-samples/blob/main/samples-old/NativeModuleSample/csharp/windows/NativeModuleSample/AsyncMethodExamples.cs).

### `SimpleHttpModule` in C++/WinRT

Expand Down Expand Up @@ -260,7 +260,7 @@ We've defined an `AsyncActionCompletedHandler` lambda and set it to be run when

> **Important:** This example shows the minimum case, where you don't handle any errors within `GetHttpResponseAsync`, but you're not limited to this. You're free to detect error conditions within your code and call `capturedPromise.Reject()` yourself with (more useful) error messages at any time. However you should *always* include this final handler, to catch any unexpected and unhandled exceptions that may occur, especially when calling Windows APIs. Just be sure that you only call `Reject()` once and that nothing executes afterwards.

That's it! If you want to see the complete `SimpleHttpModule`, see [`AsyncMethodExamples.h`](https://github.com/microsoft/react-native-windows-samples/blob/main/samples/NativeModuleSample/cppwinrt/windows/NativeModuleSample/AsyncMethodExamples.h).
That's it! If you want to see the complete `SimpleHttpModule`, see [`AsyncMethodExamples.h`](https://github.com/microsoft/react-native-windows-samples/blob/main/samples-old/NativeModuleSample/cppwinrt/windows/NativeModuleSample/AsyncMethodExamples.h).

## Executing calls to API on the UI thread

Expand Down
2 changes: 1 addition & 1 deletion docs/native-modules-marshalling-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The end-to-end data flow looks something like this:

## Examples

For examples of using data automatically marshaled into both static and dynamic native types, see the `DataMarshalingExamples` module within the [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples/NativeModuleSample). Implementations for both C# and C++/WinRT are provided.
For examples of using data automatically marshaled into both static and dynamic native types, see the `DataMarshalingExamples` module within the [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples-old/NativeModuleSample). Implementations for both C# and C++/WinRT are provided.

For further examples of using the dynamic `JSValue` type, see [Using `JSValue`](native-modules-jsvalue.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/native-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Native Modules
> **This documentation and the underlying platform code is a work in progress.**
> **Examples (C# and C++/WinRT):**
>
> - [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples/NativeModuleSample)
> - [Native Module Sample in `microsoft/react-native-windows-samples`](https://github.com/microsoft/react-native-windows-samples/tree/main/samples-old/NativeModuleSample)
> - [Sample App in `microsoft/react-native-windows/packages/microsoft-reactnative-sampleapps`](https://github.com/microsoft/react-native-windows/tree/main/packages/sample-apps)

Sometimes an app needs access to a platform API that React Native doesn't have a corresponding module for yet. Maybe you want to reuse some existing .NET code without having to re-implement it in JavaScript, or write some high performance, multi-threaded code for image processing, a database, or any number of advanced extensions.
Expand Down