Giter Site home page Giter Site logo

Comments (10)

Kureev avatar Kureev commented on August 15, 2024

NavigatorNavigationBarStyles and StaticContainer.react are deprecated in 0.7.x+, we need to replace them with analogs in latest versions

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

Yep 👍

from react-native-navbar.

Kureev avatar Kureev commented on August 15, 2024

@piyushchauhan2011 should be solved in v0.6.1 ;) Check it out.

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

@Kureev Still getting some error.

screen shot 2015-07-16 at 6 16 37 pm

'use strict';

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;

var NavigationBar = require('react-native-navbar');

var InitialView = React.createClass({
  render: function() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.ios.js
        </Text>
        <Text style={styles.instructions}>
          Press Cmd+R to reload,{'\n'}
          Cmd+D or shake for dev menu
        </Text>
      </View>
    );
  }
});

var HelloTest = React.createClass({

  renderScene: function(route, navigator) {
    var Component = route.component;
    var navBar = route.navigationBar;

    if(navBar) {
      navBar = React.addons.cloneWithProps(navBar, {
        navigator: navigator,
        route: route
      });
    }

    return (
      <View style={styles.navigator}>
        {navBar}
        <Component navigator={navigator} route={route}/>
      </View>
    );
  },

  render: function() {
    return (
      <Navigator
        renderScene={this.renderScene}
        initialRoute={{
          component: InitialView,
          navigationBar: <NavigationBar title="Initial View" style={styles.navigator}/>
        }}
      />
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  navigator: {
    flex: 1,
  }
});

AppRegistry.registerComponent('HelloTest', () => HelloTest);

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

screen shot 2015-07-16 at 6 23 51 pm

from react-native-navbar.

Kureev avatar Kureev commented on August 15, 2024

Super informative stack trace 😄

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

😄

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

Forgot the Navigator while destructuring. Silly mistake!

from react-native-navbar.

Kureev avatar Kureev commented on August 15, 2024

Perfect, so everything works fine now?

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on August 15, 2024

Yep 👍

from react-native-navbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.