Skip to content

Conversation

@CptFabulouso
Copy link
Contributor

Support deprecated receiveCommand which receives commandId as int.

It may be RN bug and also dependent on RN version, but running on RN 0.76.2 (old arch), the receiveCommand which accepts String commandId is never called, therefore calling focus() and blur() functions does nothing. Here we manually delegate this call using the deprecated receiveCommand. JS sends the command id as Int.

Support deprecated receiveCommand which receives commandId as int.

It may be RN bug and also dependent on RN version, but running on RN 0.76.2 (old arch), the `receiveCommand` which accepts `String commandId` is never called, therefore calling `focus()` and `blur()` functions does nothing. Here we manually delegate this call using the deprecated `receiveCommand`. JS sends the command id as Int.
Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@Naturalclar Naturalclar merged commit 0d00e13 into react-native-picker:master Nov 26, 2024
6 of 12 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 26, 2024
## [2.9.1](v2.9.0...v2.9.1) (2024-11-26)

### Bug Fixes

* Add deprecated receiveCommand method ([#601](#601)) ([0d00e13](0d00e13))
@Naturalclar
Copy link
Contributor

🎉 This PR is included in version 2.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@CptFabulouso
Copy link
Contributor Author

@Naturalclar I'm in the middle of migrating some lib to new arch and in here I see that they pass a string name for the command (on the old arch), so that's probably how it should be done? That would mean to change this call to this (+ the blur function):

UIManager.dispatchViewManagerCommand(
            findNodeHandle(pickerRef.current),
            'focus',
            [],
          );

I mean, with the change I made, it works too, but maybe this change would be better, since in this PR I override deprecated method?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants