Skip to content

feat: add support for screenId prop allowing for native screen recognition #2967

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
merged 6 commits into from
Jun 11, 2025

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Jun 6, 2025

Description

Add support for screenId prop on native side. At the moment we use this value only in JS code.
It was brought to my attention, however, that other libs that wanna integrate might want that
to be exposed also on native side.

Changes

Added screenId prop & exposed it on both platforms.

Test code and steps to reproduce

Any example & add a breakpoint at setter method.

Checklist

  • Ensured that CI passes

kkafar added 6 commits June 6, 2025 05:56
On Paper the default value of '' wouldn't be translated to nil in native
code. Now this is done by addition of custom setter logic (only for
Paper).
This is not necessary. On Paper we're fine with getting `undefined`
& on Fabric the default will be applied by codegened layer.
@kkafar kkafar requested review from kligarski and maciekstosio June 6, 2025 04:25
Copy link
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

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

Looks good. I'm thinking that maybe we should add info about screenId to GUIDE_FOR_LIBRARY_AUTHORS.md as well?

@interface RNSScreenStackView ()

/**
* \return Arrray with ids of screens owned by this stack. Ids are returned in no particular order. The list might be
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
* \return Arrray with ids of screens owned by this stack. Ids are returned in no particular order. The list might be
* \return Array with ids of screens owned by this stack. Ids are returned in no particular order. The list might be

@kkafar kkafar merged commit 8b82e08 into main Jun 11, 2025
11 of 12 checks passed
@kkafar kkafar deleted the @kkafar/pass-key-down-to-the-screen branch June 11, 2025 10:07
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