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

registerCommandListener => pass passedProps #4716

Closed
jfrolich opened this issue Feb 11, 2019 · 9 comments · Fixed by #5126
Closed

registerCommandListener => pass passedProps #4716

jfrolich opened this issue Feb 11, 2019 · 9 comments · Fixed by #5126

Comments

@jfrolich
Copy link

Issue Description

It would be nice to have the passedProps available in registerCommandListener. For instance when globally sending screen events for analytics purposes.

@guyca
Copy link
Collaborator

guyca commented Feb 11, 2019

This is indeed a great suggestion, We've noticed this as well. The issue is actually pretty simple to fix, perhaps someone would like to submit a PR.

Basically, passProps are omitted from commands and stored in internally. This is done since props are not guaranteed to be serialisable so they can't be passed over the bridge. Also, props might be pretty large, in which case passing them over the bridge hinders performance.

Once a component is mounted we inject props and clear them from store. We should continue omitting props from objects passed over the bridge, while still including them in command events.

@jfrolich
Copy link
Author

OK let me see if I can add a pull request for this

@pribeh
Copy link

pribeh commented Mar 22, 2019

@jfrolich any luck with this?

@jfrolich
Copy link
Author

Nope, wish I had the time, but we need this soon in our app, so I'll will have to look into this soon.

@jfrolich
Copy link
Author

Just published a pull request for this!

@pribeh
Copy link

pribeh commented Mar 31, 2019

@jfrolich wicked! How would i use copiedLayoutNode then?

@jfrolich
Copy link
Author

jfrolich commented Apr 1, 2019

You don't need to use that, that just makes sure that passed props is not always null in the screen parameter of registerCommandListener.

@guyca
Copy link
Collaborator

guyca commented May 22, 2019

Thanks to @yogevbd, passProps are now (v2.20.0) available in command events 👍

@Frenchford
Copy link

@guyca what about v7.1.0?
passProps are unavailable

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

Successfully merging a pull request may close this issue.

4 participants