Skip to content

fix: correctly replace app name in file path #396

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

Merged

Conversation

vinzscam
Copy link
Contributor

Summary

Fixed an issue causing file paths to lose the first slash when using RnDiffApp as app name or an empty string after editing the input. A similar fix might need to be applied to appPackage, but I refrained from doing so to avoid potential side effects on any underlying component, as the value can be nullable.

Screenshot 2025-02-27 at 18 10 05

I know there was already #379 open, but we used this fix in our fork and we thought it was good to contribute upstream. Feel free to ignore this PR if another fix is more suitable 😊

What are the steps to reproduce?

  1. Type: RnDiffApp in the app name input
  2. Press "Show me how to upgrade!"
  3. You will see that the path of each file is wrong.

or

  1. Type anything in the app name input
  2. Clear the app name input
  3. Press "Show me how to upgrade!"
  4. You will see that the path of each file is wrong.

Checklist

  • I tested this thoroughly
  • I added the documentation in README.md (if needed)

Copy link
Member

@pvinis pvinis left a comment

Choose a reason for hiding this comment

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

could you apply these to make things more typescript-y, and we can merge. thank you for this fix!

Co-authored-by: Pavlos Vinieratos <[email protected]>
@pvinis pvinis merged commit 671a552 into react-native-community:master Feb 27, 2025
1 check passed
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.

2 participants