Skip to content

Commit 3025c02

Browse files
Pavlo AksonovPavlo Aksonov
Pavlo Aksonov
authored and
Pavlo Aksonov
committed
fix header/footer, #112
1 parent 5dff701 commit 3025c02

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ExRouter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export class ExRouteAdapter {
5454
:
5555
React.cloneElement(React.Children.only(this.route.children), {...this.route.props, data:this.props, route:this.route});
5656

57-
const Header = this.route.props.header;
57+
const Header = this.route.header;
5858
const header = Header ? <Header {...this.route.props} {...this.props}/> : null;
5959

60-
const Footer = this.route.props.footer;
60+
const Footer = this.route.footer;
6161
const footer = Footer ? <Footer {...this.route.props} {...this.props}/> : null;
6262

6363
return (
@@ -263,7 +263,7 @@ export default class ExRouter extends React.Component {
263263
<ExNavigator ref="nav" initialRouteStack={router.stack.map(route => new ExRouteAdapter(router.routes[route]))}
264264
style={styles.transparent}
265265
sceneStyle={{ paddingTop: 0 }}
266-
renderNavigationBar={props=><ExNavigationBar {...props} router={router} navigationStyles={Navigator.NavigationBar.StylesIOS}/>}
266+
renderNavigationBar={props=><ExNavigationBar {...props} router={router}/>}
267267
{...this.props}
268268
/>
269269
{footer}

Example/Example.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ class TabIcon extends React.Component {
1919
}
2020
}
2121

22+
class Header extends React.Component {
23+
render(){
24+
return <Text>Header</Text>
25+
}
26+
}
27+
2228
export default class Example extends React.Component {
2329
render() {
2430
return (
@@ -51,7 +57,7 @@ export default class Example extends React.Component {
5157
<Route name="tab5" schema="tab" title="Tab #5" component={TabView} />
5258
</Router>
5359
</Route>
54-
<Route name="launch" component={Launch} wrapRouter={true} title="Launch" hideNavBar={true} initial={true}/>
60+
<Route name="launch" header={Header} component={Launch} wrapRouter={true} title="Launch" hideNavBar={true} initial={true}/>
5561
</Router>
5662
);
5763
}

0 commit comments

Comments
 (0)