microsoft / microsoft/react-native-windows-samples

Upgrade Native Modules Apps to 0.80.0

Open
#1,060 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

enhancement Workstream: Gallery and Samples
Dominant language
C#
Stars
544
Forks
218
PR merge metrics
No merged PRs in 30d

Description

Refer to this PR for reference:https://github.com/microsoft/react-native-windows-samples/pull/1062/files

Update all package.json files under the Native Modules directory to use react-native-windows@0.80.0. The diff should be similar to the above PR but scoped only to Native Modules.

Below instructions can help you complete this task:

  • yarn install
  • yarn prepare

To run the app yarn example windows

First run the Setup steps above. Then run the UpgradeSmokeTest.ps1 script with the target RNW version (usually latest):
.......github\scripts\UpgradeSmokeTest.ps1 latest $True $True $True
Then call the following to update the JS and codegen with:

	yarn prepare	
	yarn codegen-windows

Finally, build and verify both example apps as per the Run steps above. If both apps work without issue, then go ahead and submit the PR with your changes.

If you get this error:

Building Solution: C:\Users\hmalothu\.nuget\packages\microsoft.reactnative.cxx\0.79.0\build\native\Microsoft.R...
 × Build failed with message 3:10>C:\Users\hmalothu\.nuget\packages\microsoft.reactnative.cxx\0.79.0\build\native\Microsoft.ReactNative.VersionCheck.targets(96,5): error : Mismatch detected between npm package versions and nuget package version. [G:\react-native-windows-samples\samples\NativeModuleSample\cpp-lib\windows\NativeModuleSample\NativeModuleSample.vcxproj]. Check your build configuration.

What to do?
change your package reference in nativemodulesample.vcxproj and  nativemodulesampleexample.vcxproj

<ItemGroup>
    <PackageReference Include="Microsoft.ReactNative">
      <Version>0.80.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.ReactNative.Cxx">
      <Version>0.80.0</Version>
    </PackageReference>

If you get these kind of errors

Error: Unable to resolve module ./Libraries/Utilities/warnOnce from G:\react-native-windows-samples\samples\NativeModuleSample\cpp-lib\example\node_modules\react-native-windows\index.windows.js:

None of these files exist:

node_modules\react-native-windows\Libraries\Utilities\warnOnce(.windows.js|.native.js|.js|.windows.jsx|.native.jsx|.jsx|.windows.json|.native.json|.json|.windows.ts|.native.ts|.ts|.windows.tsx|.native.tsx|.tsx)
node_modules\react-native-windows\Libraries\Utilities\warnOnce
110 | // Windows]]
111 |
112 | const warnOnce = require('./Libraries/Utilities/warnOnce').default;
| ^
113 | const invariant = require('invariant');

what to do?
npx react-native start --reset-cacheCorrupted modules: Sometimes npm packages can get corrupted during installation, causing module resolution issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.