Skip to content

Add support for passing props to a screen in Android#41

Merged
yedidyak merged 6 commits into
masterfrom
passProps
May 29, 2016
Merged

Add support for passing props to a screen in Android#41
yedidyak merged 6 commits into
masterfrom
passProps

Conversation

@yedidyak
Copy link
Copy Markdown
Contributor

No description provided.

yedidyak added 4 commits May 25, 2016 13:42
Anything passed in a navigator event in a 'passProps' object will be serialized into the Java side Screen object as a HashMap<String, Object>. When RctView starts the React root the props are deserialized into the Bundle passed as props, along with the navigation info. Due to React and Java limitations, JS arrays of arrays are deserialized as dictionaries by index, and arrays of multiple types are not supported.
navigatorId = getString(screen, KEY_NAVIGATOR_ID);
navigatorEventId = getString(screen, KEY_NAVIGATOR_EVENT_ID);
icon = getInt(screen, KEY_ICON);
if(screen.hasKey(KEY_PROPS))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add Braces to conditional statement. We follows google's code style conventions.

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