Comments (5)
Can you share an example?
from react-native-navbar.
Little background on what I'm doing.
I'm trying to implement React Native into an existing Obj C app:
https://facebook.github.io/react-native/docs/embedded-app-ios.html#content
Currently I have an extra native Obj C navigator (the equivalent of the navigatorIOS) above the navigator. But this shouldn't really have an effect on the navigator which shows up correctly and the Swipe method works and such.
Here's where the navigator is initialized... (The -64 is because of the extra IOSnavbar above)
const React = require('react-native');
const {
Navigator,
View,
Text,
StyleSheet,
} = React;
const { bindActionCreators } = require('redux');
const { Connector } = require('redux/react-native');
const SearchPage = require('../Components/SearchPage');
const Dimensions = require('Dimensions');
const deviceWidth = Dimensions.get('window').width;
// The magic number 64. This is a number we got from Facebook
const deviceHeight = Dimensions.get('window').height - 64;
const styleConstants = require('../styles/styleConstants');
const styleComponent = StyleSheet.create(require('../styles/Search'));
const SearchActions = require('../Actions/SearchActions');
const NavigationBar = require('react-native-navbar');
const Search = React.createClass({
render() {
return (
<Connector select={state => ({ pax: state.pax })}>
{this.renderChild}
</Connector>
);
},
renderChild({ pax, dispatch }) {
const actions = bindActionCreators(SearchActions, dispatch);
return (
<Navigator
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.PushFromRight;
}}
initialRoute={{
navigationBar:
<NavigationBar
title="Search"
titleColor="#FFFFFF"
buttonsColor="#FFFFFF"
hidePrev={true}
/>,
title: 'Search',
component: SearchPage,
}}
/>
);
},
renderScene: function(route, navigator) {
var Component = route.component;
var navBar = route.navigationBar;
var navBarStyle = {
backgroundColor: '#4896C4'
}
if (navBar) {
navBar = React.addons.cloneWithProps(navBar, {
navigator: navigator,
route: route,
style: navBarStyle
});
}
return (
<View style={{width: deviceWidth, height: deviceHeight}}>
{navBar}
<Component {...route.passProps} navigator={navigator} route={route} />
</View>
);
}
});
module.exports = Search;
And here's how I push onto the navigator (where there's no "Back" button showing on the 0.8.2, but shows up on 0.7.3)
this.props.navigator.push({
navigationBar:
<NavigationBar
title="Results"
titleColor="#FFFFFF"
buttonsColor="#FFFFFF"
/>,
title: 'Results',
component: SearchResults,
passProps: { rates: search },
});
Let me know if you want a full working example and I'll try and put it together later today or tomorrow
from react-native-navbar.
Hm, I'm afraid that plugin has been designed to work with Navigator
component, because it pass down navigator
property to it's children. Probably, to solve your issue you need just pass navigator
property thru. Take a look on this part of the code: https://github.com/Kureev/react-native-navbar/blob/master/index.js#L23-L36
from react-native-navbar.
Sry, for the late response. You're right it works correctly now.
We went over to using CustomPrev and 7.3 so I hadn't tested this.
Thank you 😁
from react-native-navbar.
You're always welcome, man! ☀️
from react-native-navbar.
Related Issues (20)
- What version of react-native is required? HOT 5
- 1.8.1 is not support in react-native 0.41.2 HOT 2
- Left and Right buttons won't show together HOT 2
- Put image instead of title HOT 6
- iphoneX additional padding? HOT 4
- Drag back handle HOT 6
- header text with icons HOT 6
- App Exits without showing any error HOT 2
- iOS 11 largeTitle
- applying FontFamily to style object giving Error HOT 1
- Disabled option in button configs doesn't work
- remove bottom value for Customtitle style
- Review Pull Requests
- Hiding status bar HOT 1
- KeyboardAvoidingView overlap NavitationBar
- View.propTypes on Android Production causing the app to crash
- Wrapping SafeAreaView creates a white gap between the navbar and status bar HOT 3
- return an error when I import NavigationBar HOT 1
- tried to register two views with the same name GestureHandlerRootView HOT 5
- Add screenshots to examples to make usage clear without cloning/looking at code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-navbar.