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

Fixed TypeScript error with UIManager.MyViewManager.Commands.create in MyView.tsx Android Native UI Components #4172 #4253

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

Conversation

muhammadashfaq
Copy link
Contributor

@muhammadashfaq muhammadashfaq commented Oct 8, 2024

PR Title:

Fixed TypeScript error with UIManager.MyViewManager.Commands.create in MyView.tsx

Description:

This PR addresses a TypeScript error that occurs when accessing UIManager.MyViewManager.Commands.create.toString() in MyView.tsx. The direct reference to UIManager.MyViewManager.Commands may not be available or initialized properly, especially in some environments, which causes issues when working with custom native view managers.

Changes:

  • Replaced UIManager.MyViewManager.Commands.create.toString() with the more reliable UIManager.getViewManagerConfig('MyViewManager').Commands.create.toString() to ensure that the view manager configuration is correctly fetched and initialized before using the command.

This fix ensures compatibility and prevents errors when working with custom native components on both Android.

Closes issue #4172.

Testing:

  • Verified that the new approach resolves the TypeScript error.
  • Tested on Android to ensure the UIManager configurations are fetched correctly.

Copy link

netlify bot commented Oct 8, 2024

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit 96d1601
🔍 Latest deploy log https://app.netlify.com/sites/react-native/deploys/67050f5eafaece000889fa08
😎 Deploy Preview https://deploy-preview-4253--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@muhammadashfaq muhammadashfaq changed the title Fixed TypeScript error with UIManager.MyViewManager.Commands.create in MyView.tsx #4172 Fixed TypeScript error with UIManager.MyViewManager.Commands.create in MyView.tsx Android Native UI Components #4172 Oct 8, 2024
@muhammadashfaq
Copy link
Contributor Author

@cortinico

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Let's make sure the CI is green 👍

@muhammadashfaq
Copy link
Contributor Author

Let's make sure the CI is green 👍

@cortinico CI is green 👍

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

Successfully merging this pull request may close these issues.

3 participants