Skip to content

Commit 286799b

Browse files
Cut docs for 76 (#990)
## Description Cuts the docs for 76 release! Also resolves #987 ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/react-native-windows-samples/pull/990) --------- Co-authored-by: Jon Thysell <[email protected]>
1 parent c64d7f3 commit 286799b

24 files changed

+1505
-9
lines changed

docs/getting-started.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ npx react-native init-windows --overwrite
6969

7070
> **Note:** RNW templates contain a customized `metro.config.js` file, which is meant to merge cleanly into the default config provided by the standard React Native project template. If you are starting a new app, overwriting `metro.config.js` should have no impact. However, if you are adding Windows to an existing app with an already modified `metro.config.js` file, please make sure to back up and re-apply your modifications after adding RNW.
7171
72-
> **Note:** Previous versions of the RNW Getting Started steps recommend the use of the `react-native-windows-init` command, which is being phased out. For documentation of that command, see: [React Native Windows Init CLI](https://microsoft.github.io/react-native-windows/init-cli).
73-
7472
## Running a React Native Windows App
7573

7674
> Make sure a browser is launched and running before running a React Native Windows app.
@@ -134,6 +132,3 @@ Follow these steps to build a version of your app that you can install or publis
134132
> If you're getting different runtime behavior between the Release and Debug configurations, consider disabling the `UseWebDebugger` setting in [`App.cpp`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cpp-app/src/App.cpp#L30) or [`App.xaml.cs`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cs-app/src/App.xaml.cs#L20) to get the same behavior in the Debug configuration.
135133
136134
See also this article for additional details: https://techcommunity.microsoft.com/t5/windows-dev-appconsult/getting-started-with-react-native-for-windows/ba-p/912093#
137-
138-
</body>
139-
</html>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: EmitEventSetterDelegate
3+
title: EmitEventSetterDelegate
4+
---
5+
6+
Kind: `delegate`
7+
8+
A delegate gets the arguments for an event emit on a EventEmitter.
9+
10+
## Invoke
11+
void **`Invoke`**([`JSValueArgWriter`](JSValueArgWriter) argWriter)
12+
13+
14+
15+
16+
17+
## Referenced by
18+
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: EventEmitterInitializerDelegate
3+
title: EventEmitterInitializerDelegate
4+
---
5+
6+
Kind: `delegate`
7+
8+
A delegate to call a turbo module EventEmitter.
9+
10+
## Invoke
11+
void **`Invoke`**([`EmitEventSetterDelegate`](EmitEventSetterDelegate) emitter)
12+
13+
14+
15+
16+
17+
## Referenced by
18+
- [`IReactModuleBuilder`](IReactModuleBuilder)

docs/native-api/IReactModuleBuilder-api-windows.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ Adds a constant provider method to define constants for the native module. See [
2020

2121

2222

23+
### AddEventEmitter
24+
void **`AddEventEmitter`**(string name, [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate) emitter)
25+
26+
Adds an EventEmitter to the turbo module. See [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate).
27+
28+
29+
2330
### AddInitializer
2431
void **`AddInitializer`**([`InitializerDelegate`](InitializerDelegate) initializer)
2532

docs/native-api/JSValueArgWriter-api-windows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ void **`Invoke`**([`IJSValueWriter`](IJSValueWriter) writer)
1616

1717

1818
## Referenced by
19+
- [`EmitEventSetterDelegate`](EmitEventSetterDelegate)
1920
- [`IReactContext`](IReactContext)
2021
- [`ReactRootView`](ReactRootView)
2122
- [`ReactViewOptions`](ReactViewOptions)

docs/native-api/index-api-windows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ sidebar_label: Full reference
112112
- [`AccessibilityActionEventHandler`](AccessibilityActionEventHandler)
113113
- [`AccessibilityInvokeEventHandler`](AccessibilityInvokeEventHandler)
114114
- [`ConstantProviderDelegate`](ConstantProviderDelegate)
115+
- [`EmitEventSetterDelegate`](EmitEventSetterDelegate)
116+
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
115117
- [`InitializerDelegate`](InitializerDelegate)
116118
- [`JSValueArgWriter`](JSValueArgWriter)
117119
- [`JsiByteArrayUser`](JsiByteArrayUser)

website/.unbroken_exclusions

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
!versioned_docs/version-0.73/native-api/*-api-windows*.md
1515
!versioned_docs/version-0.74/native-api/*-api-windows*.md
1616
!versioned_docs/version-0.75/native-api/*-api-windows*.md
17+
!versioned_docs/version-0.76/native-api/*-api-windows*.md
1718

1819
# See Issue 410
1920
File not found IReactContext while parsing versioned_docs/version-0.64/native-modules-advanced.md
@@ -25,8 +26,24 @@ File not found IViewManagerCreateWithProperties while parsing versioned_docs/ver
2526
File not found native-api/IReactPackageProvider-api-windows.md while parsing versioned_docs/version-0.72/coreapp.md
2627
File not found native-api/IReactContext-api-windows.md while parsing versioned_docs/version-0.72/native-modules-advanced.md
2728
File not found native-api/ReactNativeHost-api-windows.md while parsing versioned_docs/version-0.72/native-modules-advanced.md
29+
File not found IViewManagerCreateWithProperties while parsing versioned_docs/version-0.76/view-managers.md
2830

2931
#fix-unbroken.js auto-generated do not edit this line or below
32+
File not found autolink-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
33+
File not found getting-started.md while parsing versioned_docs/version-0.76/getting-started.md
34+
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
35+
File not found run-windows-cli.md while parsing versioned_docs/version-0.76/getting-started.md
36+
File not found native-modules.md while parsing versioned_docs/version-0.76/getting-started.md
37+
File not found rnw-dependencies.md while parsing versioned_docs/version-0.76/getting-started.md
38+
File not found getting-started.md while parsing versioned_docs/version-0.76/new-architecture.md
39+
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/new-architecture.md
40+
File not found getting-started.md while parsing versioned_docs/version-0.76/nuget.md
41+
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/nuget.md
42+
File not found supported-community-modules.md while parsing versioned_docs/version-0.76/nuget.md
43+
File not found getting-started.md while parsing versioned_docs/version-0.76/view-managers.md
44+
File not found init-windows-cli.md while parsing versioned_docs/version-0.76/view-managers.md
45+
File not found native-modules-setup.md while parsing versioned_docs/version-0.76/view-managers.md
46+
File not found native-modules.md while parsing versioned_docs/version-0.76/view-managers.md
3047
File not found run-windows-cli.md while parsing versioned_docs/version-0.75/autolink-windows-cli.md
3148
File not found run-windows-cli.md while parsing versioned_docs/version-0.75/debugging-javascript.md
3249
File not found getting-started.md while parsing versioned_docs/version-0.75/getting-started.md

website/pages/en/support.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ The React Native for Windows (RNW) Team strives to provide full support for the
1616
| Version | Support Phase | Release Date | Active Support Start | Maintenance Support Start | End of Support |
1717
| -- | -- | -- | -- | -- | -- |
1818
| [main](https://www.npmjs.com/package/react-native-windows/v/canary) | [Canary](#canary-support) | *N/A* | *N/A* | *N/A* | *N/A* |
19-
| [0.75](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 8/19/2024 | 8/19/2024 | *TBD* | *TBD* |
19+
| [0.76](https://www.npmjs.com/package/react-native-windows/v/latest) | [Active](#active-support) | 11/11/2024 | 11/11/2024 | *TBD* | *TBD* |
20+
| [0.75](https://www.npmjs.com/package/react-native-windows/v/v0.75-stable) | [Active](#active-support) | 8/19/2024 | 8/19/2024 | 12/31/2024 | 02/28/2025 |
2021
| [0.74](https://www.npmjs.com/package/react-native-windows/v/v0.74-stable) | [Maintenance](#maintenance-support) | 4/29/2024 | 4/29/2024 | 9/30/2024 | 11/30/2024 |
2122
| [0.73](https://www.npmjs.com/package/react-native-windows/v/v0.73-stable) | [Unsupported](#unsupported) | 12/11/2023 | 12/11/2023 | 5/31/2024 | 7/31/2024 |
2223
| [0.72](https://www.npmjs.com/package/react-native-windows/v/v0.72-stable) | [Unsupported](#unsupported) | 06/23/2023 | 06/23/2023 | 01/31/2024 | 03/31/2024 |

website/siteConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// See https://docusaurus.io/docs/site-config for all the possible
99
// site configuration options.
1010

11-
const defaultVersionShown = "0.75";
11+
const defaultVersionShown = "0.76";
1212
const repoUrl = "https://github.com/microsoft/react-native-windows";
1313

1414
const siteConfig = {

website/versioned_docs/version-0.74/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
2424
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2525

2626
```bat
27-
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"
27+
npx --yes @react-native-community/cli@latest init <projectName> --version "0.74-stable"
2828
```
2929

3030
### Navigate into this newly created directory

website/versioned_docs/version-0.75/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
2424
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
2525

2626
```bat
27-
npx --yes @react-native-community/cli@next init <projectName> --version "latest"
27+
npx --yes @react-native-community/cli@latest init <projectName> --version "0.75-stable"
2828
```
2929

3030
### Navigate into this newly created directory
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
id: version-0.76-getting-started
3+
title: Get Started with Windows
4+
original_id: getting-started
5+
---
6+
7+
This guide will help you get started on setting up your very first React Native for Windows app.
8+
9+
Make sure you have installed all of the [development dependencies](rnw-dependencies.md).
10+
11+
For information around how to set up React Native, see the [React Native Getting Started Guide](https://reactnative.dev/docs/getting-started).
12+
13+
> **Interested in migrating to [React Native's New Architecture](https://reactnative.dev/architecture/landing-page)?** New Architecture support in React Native for Windows is now available to preview in 0.76. Note there are several key changes, so if you’d like to be an early adopter, check out the information in the [New Architecture Guide](new-architecture.md).
14+
15+
## Create a new React Native project
16+
17+
Remember to call `@react-native-community/cli init` from the place you want your project directory to live.
18+
19+
<!-- Note, make sure both `@react-native-community/cli@ABC` and `--version "XYZ"` are pointing to the correct NPM tags in the command below. -->
20+
21+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "next" for the CLI and "nightly" for the RN version -->
22+
<!-- 2. For the latest stable version in versioned_docs use "latest" for both the CLI and RN version -->
23+
<!-- 3. For older stable versions you'll have to look up the CLI version, but for the RN version use the stable tag name, i.e. "0.73-stable" -->
24+
25+
<!-- See https://www.npmjs.com/package/@react-native-community/cli?activeTab=versions for the CLI version tags. -->
26+
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->
27+
28+
```bat
29+
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"
30+
```
31+
32+
### Navigate into this newly created directory
33+
34+
React Native will have created your project in a new sub-directory, which you must enter before continuing.
35+
36+
```bat
37+
cd <projectName>
38+
```
39+
40+
### Add React Native Windows to your project's dependencies
41+
42+
<!-- Note, make sure "version" is pointing to the correct react-native-windows NPM tag in the command below. -->
43+
44+
<!-- 1. For the next version (i.e. in docs/getting-started.md) use "canary" -->
45+
<!-- 2. For other versions in versioned_docs use the version in the format "^0.XY.0" -->
46+
47+
<!--DOCUSAURUS_CODE_TABS-->
48+
49+
<!--Using Yarn (Recommended)-->
50+
51+
```bat
52+
yarn add react-native-windows@^0.76.0
53+
```
54+
55+
<!--Using NPM-->
56+
57+
```bat
58+
npm install --save react-native-windows@^0.76.0
59+
```
60+
61+
<!--END_DOCUSAURUS_CODE_TABS-->
62+
63+
### Initialize the React Native Windows native code and projects
64+
65+
Lastly, initialize the React Native for Windows application with the [init-windows command](init-windows-cli.md):
66+
67+
```bat
68+
npx react-native init-windows --overwrite
69+
```
70+
71+
> **Note:** RNW templates contain a customized `metro.config.js` file, which is meant to merge cleanly into the default config provided by the standard React Native project template. If you are starting a new app, overwriting `metro.config.js` should have no impact. However, if you are adding Windows to an existing app with an already modified `metro.config.js` file, please make sure to back up and re-apply your modifications after adding RNW.
72+
73+
## Running a React Native Windows App
74+
75+
> Make sure a browser is launched and running before running a React Native Windows app.
76+
> Also ensure your system meets all the [requirements](rnw-dependencies.md) to build a Windows app as well.
77+
78+
- Without Using Visual Studio
79+
80+
In your React Native Windows project directory, run the [run-windows command](run-windows-cli.md):
81+
82+
```bat
83+
npx react-native run-windows
84+
```
85+
86+
A new Command Prompt window will open with the React packager as well as your React Native for Windows app. This step may take a while during first run since it involves building the entire project and all dependencies. You can now start developing! :tada:
87+
88+
- Using Visual Studio
89+
90+
- From the root of the project directory, run the [autolink-windows command](autolink-windows-cli.md), which will automatically link your app's dependencies:
91+
```bat
92+
npx react-native autolink-windows
93+
```
94+
- Open the solution file in the application folder in Visual Studio (e.g., `AwesomeProject/windows/AwesomeProject.sln` if you used `AwesomeProject` as `<projectName>`)
95+
- Select the `Debug` configuration and the `x64` platform from the combo box controls to the left of the `Run` button and underneath the `Team` and `Tools` menu item.
96+
- Run `yarn start` (or `npm start`) from your project directory, and wait for the React Native packager to report success.
97+
- Click the `Run` button to the right of the platform combo box control in VS, or select the `Debug`->`Start without Debugging` menu item. You now see your new app and Chrome should have loaded `http://localhost:8081/debugger-ui/` in a new tab. Press `F12` or `Ctrl+Shift+I` in Chrome to open its Developer Tools. :tada:
98+
99+
- With VS Code
100+
- Open your applications folder in VS Code.
101+
- Install the [React Native Tools](https://marketplace.visualstudio.com/items?itemName=msjsdiag.vscode-react-native) plugin for VS Code.
102+
- Create a new file in the applications root directory, `.vscode/launch.json` and paste the following configuration:
103+
```json
104+
{
105+
"version": "0.2.0",
106+
"configurations": [
107+
{
108+
"name": "Debug Windows",
109+
"cwd": "${workspaceFolder}",
110+
"type": "reactnative",
111+
"request": "launch",
112+
"platform": "windows"
113+
}
114+
]
115+
}
116+
```
117+
- Press `F5` or navigate to the debug menu (alternatively press `Ctrl+Shift+D`) and in the Debug drop-down select "Debug Windows" and press the green arrow to run the application.
118+
119+
## Authoring Native Modules
120+
121+
See [Native Modules and React Native Windows](native-modules.md).
122+
123+
## Building a standalone React Native Windows App
124+
125+
Follow these steps to build a version of your app that you can install or publish to the store. This version will package your bundle and assets into the APPX package so you don't need to run Metro.
126+
127+
- Open the solution in Visual Studio
128+
- Select the Release configuration from the Configuration Manager drop-down.
129+
- Build the solution. You can now launch without first launching Metro.
130+
- If you want to build an APPX package to share or publish, use the **Project** > **Publish** > **Create App Packages...** option.
131+
132+
> The Debug configuration uses the Web Debugger by default, which means the application's JavaScript code runs in Chrome.<br>
133+
> If you're getting different runtime behavior between the Release and Debug configurations, consider disabling the `UseWebDebugger` setting in [`App.cpp`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cpp-app/src/App.cpp#L30) or [`App.xaml.cs`](https://github.com/microsoft/react-native-windows/blob/6b415659aa017dbc41e3f28e817fb768a8e80435/vnext/template/cs-app/src/App.xaml.cs#L20) to get the same behavior in the Debug configuration.
134+
135+
See also this article for additional details: https://techcommunity.microsoft.com/t5/windows-dev-appconsult/getting-started-with-react-native-for-windows/ba-p/912093#
136+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
id: version-0.76-EmitEventSetterDelegate
3+
title: EmitEventSetterDelegate
4+
original_id: EmitEventSetterDelegate
5+
---
6+
7+
Kind: `delegate`
8+
9+
A delegate gets the arguments for an event emit on a EventEmitter.
10+
11+
## Invoke
12+
void **`Invoke`**([`JSValueArgWriter`](JSValueArgWriter) argWriter)
13+
14+
15+
16+
17+
18+
## Referenced by
19+
- [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
id: version-0.76-EventEmitterInitializerDelegate
3+
title: EventEmitterInitializerDelegate
4+
original_id: EventEmitterInitializerDelegate
5+
---
6+
7+
Kind: `delegate`
8+
9+
A delegate to call a turbo module EventEmitter.
10+
11+
## Invoke
12+
void **`Invoke`**([`EmitEventSetterDelegate`](EmitEventSetterDelegate) emitter)
13+
14+
15+
16+
17+
18+
## Referenced by
19+
- [`IReactModuleBuilder`](IReactModuleBuilder)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
id: version-0.76-IReactModuleBuilder
3+
title: IReactModuleBuilder
4+
original_id: IReactModuleBuilder
5+
---
6+
7+
Kind: `interface`
8+
9+
10+
11+
Builds native module inside of ReactNative code based on the provided meta-data.
12+
See [Native Modules](native-modules) for more usage information.
13+
14+
15+
16+
## Methods
17+
### AddConstantProvider
18+
void **`AddConstantProvider`**([`ConstantProviderDelegate`](ConstantProviderDelegate) constantProvider)
19+
20+
Adds a constant provider method to define constants for the native module. See [`ConstantProviderDelegate`](ConstantProviderDelegate).
21+
22+
23+
24+
### AddEventEmitter
25+
void **`AddEventEmitter`**(string name, [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate) emitter)
26+
27+
Adds an EventEmitter to the turbo module. See [`EventEmitterInitializerDelegate`](EventEmitterInitializerDelegate).
28+
29+
30+
31+
### AddInitializer
32+
void **`AddInitializer`**([`InitializerDelegate`](InitializerDelegate) initializer)
33+
34+
Adds an initializer method called on the native module initialization.
35+
It provides the native module with the [`IReactContext`](IReactContext) for the running ReactNative instance. See [`InitializerDelegate`](InitializerDelegate).
36+
There can be multiple initializer methods which are called in the order they were registered.
37+
38+
39+
40+
### AddMethod
41+
void **`AddMethod`**(string name, [`MethodReturnType`](MethodReturnType) returnType, [`MethodDelegate`](MethodDelegate) method)
42+
43+
Adds an asynchronous method to the native module. See [`MethodDelegate`](MethodDelegate).
44+
45+
46+
47+
### AddSyncMethod
48+
void **`AddSyncMethod`**(string name, [`SyncMethodDelegate`](SyncMethodDelegate) method)
49+
50+
Adds a synchronous method to the native module. See [`SyncMethodDelegate`](SyncMethodDelegate).
51+
52+
53+
54+
55+
56+
57+
## Referenced by
58+
- [`ReactModuleProvider`](ReactModuleProvider)

0 commit comments

Comments
 (0)