-
Notifications
You must be signed in to change notification settings - Fork 212
Description
You MUST follow the description in this issue EXACTLY as written.
- Do not paraphrase, reinterpret, summarize, or add anything extra.
- Preserve all wording, formatting, code blocks, commands, and file names verbatim.
- If the description includes a README or steps, use it literally.
- Do not auto-complete or generate additional “helpful” suggestions.
- If something is unclear, stop and use exactly what is written — do not guess.
👇 The full description starts here. Copy and follow it exactly:
Do not re-interpret or suggest alternatives.
Upgrade the Calculator C# sample to use React Native Windows 0.80.x dependencies, ensuring the app builds and runs correctly
Setup
See ../README.md#Setup.
Run
See ../README.md#Run.
Upgrade
To upgrade this sample to the latest version of RNW:
-
Open a command prompt and navigate to the
samples/Calculatorfolder:cd .. -
Delete this folder:
rd /s /q csharp -
Create a new React Native app and change version to version you want to upgrade to (replace 'version' with desired version - for latest version, use 'latest'):
npx @react-native-community/cli@latest init Calculator --template @react-native-community/template@latest --skip-git-init
-
Add
yarn.lockfile to app directory (otherwiseyarn add react-native-windows@latestwill throw an error) -
Add Windows support:
cd Calculator yarn add react-native-windows@latest npx @react-native-community/cli@latest init-windows --template old/uwp-cs-app --overwrite
-
Rename the folder to csharp
cd .. ren Calculator csharp -
Restore these original app files:
cd csharp git restore README.md git restore App.tsx -
Verify the new app builds and runs:
npx @react-native-community/cli@latest run-windows -
Look at the Package.appxmanifast and change the publisher name to "CN=React Native Windows Sample". Revert all changes made to GUID values in the project and solution files.
-
Update this readme with the new major version at the top.