-
Notifications
You must be signed in to change notification settings - Fork 212
Description
Refer this PR and update all package.json for sample apps to 0.80.0-preview.1 for react-native-windows https://github.com/microsoft/react-native-windows-samples/pull/1041/files#diff-636eeb99b0e95581cba2bea9bd8e2a3b66afd0156aed21581d334d52597ef4df
This diff should be similar to above PR but only for calculator directory.
Below instructions can help you complete this task:
Calculator C++/WinRT Sample - React Native for Windows
See ../README.md for details of this sample.
See ../csharp/ for a C# version of this sample.
It currently targets React Native Windows 0.79.
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 cppwinrt -
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 a lockfile to the calculator directory:
cd Calculator yarn install -
Add Windows support:
yarn add react-native-windows@latest npx @react-native-community/cli@latest init-windows --template old/uwp-cpp-app --overwrite
-
Rename the folder to cppwinrt
cd .. ren Calculator cppwinrt -
Restore these original app files:
cd cppwinrt 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.
Calculator C# Sample - React Native for Windows
See ../README.md for details of this sample.
See ../cppwinrt/ for a C++/Winrt version of this sample.
It currently targets React Native Windows 0.79.
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.
CalculatorExperimental - React Native for Windows
This sample showcases the usage of React Native for Windows to build a simple calculator that is hosted on the experimental Fabric rendering system.
Currently this samples targets RNW 0.79
Setup
First, make sure you've met the React Native Windows System Requirements.
Then, within this folder, install the applications's dependencies. If you have yarn installed:
yarn installOtherwise, you can just use npm:
npm installRun
Once you have all of the dependencies installed, you can run the application with the following command:
npx @react-native-community/cli@latest run-windowsThe command will:
- Build the application and all dependencies
- Deploy the application
- Launch the React Native Server and Debugger
- Launch the application
Upgrade
To upgrade this sample to the latest version of RNW:
-
Open a command prompt and navigate to the
samplesfolder:cd .. -
Delete this folder:
rd /s /q fabric -
Create a new React Native app and change version to version you want to upgrade to:
npx --yes @react-native-community/cli@latest init CalculatorFabric --template @react-native-community/template@latest --skip-git-init
-
Add Windows support:
cd CalculatorFabric yarn add react-native-windows@latest npx @react-native-community/cli init-windows --template cpp-app --overwrite --logging
-
Rename the folder to fabric
cd .. ren CalculatorFabric fabric
-
Restore README.md and App.tsx
cd fabric git restore App.tsx git restore README.md -
Verify App 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 file to the current version of the App