Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix steps for creating a new app to avoid incompatible versions of react-native and react-native-windows being used #1009

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Yajur-Grover
Copy link
Contributor

@Yajur-Grover Yajur-Grover commented Feb 24, 2025

Description

Fix steps for creating a new app to avoid incompatible versions of react-native and react-native-windows being used

Why

Prevents bad experience for new users of RNW.

An issue was hit where using the latest version of react-native (0.78) to create an app would lead to it being incompatible with the latest version of react-native-windows. These steps make sure that the user is using a compatible version of react-native for their desired version of react-native-windows.

Screenshots

Add any relevant screen captures here from before or after your changes.

Microsoft Reviewers: Open in CodeFlow

@Yajur-Grover Yajur-Grover requested a review from a team as a code owner February 24, 2025 18:27
@@ -26,7 +39,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->

```bat
npx --yes @react-native-community/cli@next init <projectName> --version "latest"
npx --yes @react-native-community/cli@next init <projectName> --version "0.77.1"
Copy link
Contributor

@TatianaKapos TatianaKapos Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "0.77-stable" but Meta hasn't made that tag yet, just pinged them to create it

edit: they'll add the tag manually tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are manually creating a 0.77-stable app here, I'm not sure if you need to add the warning above, the app will always be 0.77-stable (and should be since it's the 0.77 documentation) and not use latest.


```bat
npm show react-native-windows@latest version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary - we only get out of sync in the delay between the when RN releases a new latest and then we release our matching latest.

Since they don't create a 0.XX-stable until after they release a new latest, we can't rely on that either.

I think that now that we have to use the react-native community CLI, it's easier to just call init with a hat version : ^0.77.0

@@ -26,7 +39,7 @@ Remember to call `@react-native-community/cli init` from the place you want your
<!-- See https://www.npmjs.com/package/react-native?activeTab=versions for the RN version tags. -->

```bat
npx --yes @react-native-community/cli@next init <projectName> --version "latest"
npx --yes @react-native-community/cli@next init <projectName> --version "0.77.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npx --yes @react-native-community/cli@next init <projectName> --version "0.77.1"
npx --yes @react-native-community/cli@next init <projectName> --version "^0.77.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants