Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ios/RCCNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ - (instancetype)initWithProps:(NSDictionary *)props children:(NSArray *)children

[self setRotation:props];

NSArray* components = props[@"components"];
if (components.count) {
for (NSDictionary* component in components) {
[self performAction:@"push" actionParams:@{@"animated": @(0), @"component": component[@"screen"]} bridge:bridge];
}
}

return self;
}

Expand Down
23 changes: 20 additions & 3 deletions src/deprecated/platformSpecificDeprecated.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ async function startTabBasedApp(params) {
params.tabs.map(function(tab, index) {
const navigatorID = controllerID + '_nav' + index;
const screenInstanceID = _.uniqueId('screenInstanceID');
if (!tab.screen) {

const components = tab.components;
if (!tab.screen && !components) {
console.error('startTabBasedApp(params): every tab must include a screen property, take a look at tab#' + (index + 1));
return;
}

if (components) {
params.tabs[index].components = components;
Object.assign(tab, components[0]);
components.shift();
}

const {
navigatorStyle,
navigatorButtons,
Expand Down Expand Up @@ -98,6 +107,7 @@ async function startTabBasedApp(params) {
subtitle={tab.subtitle}
titleImage={tab.titleImage}
component={tab.screen}
components={tab.components}
passProps={{
navigatorID: tab.navigationParams.navigatorID,
screenInstanceID: tab.navigationParams.screenInstanceID,
Expand All @@ -123,13 +133,19 @@ async function startTabBasedApp(params) {
}

async function startSingleScreenApp(params) {
if (!params.screen) {
const components = params.components;
let screen = params.screen;
if (!screen && !components) {
console.error('startSingleScreenApp(params): params.screen is required');
return;
}

if (components) {
screen = components[0];
components.shift();
}

const controllerID = _.uniqueId('controllerID');
const screen = params.screen;
if (!screen.screen) {
console.error('startSingleScreenApp(params): screen must include a screen property');
return;
Expand Down Expand Up @@ -183,6 +199,7 @@ async function startSingleScreenApp(params) {
subtitle={params.subtitle}
titleImage={screen.titleImage}
component={screen.screen}
components={components}
passProps={{
navigatorID: navigatorID,
screenInstanceID: screenInstanceID,
Expand Down