0.1.4 • Published 9 years ago

react-addressbar v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

react-addressbar

Take control of the addressbar in a reactive way

This component depends on addressbar, a library that makes the addressbar work like an input. This means that you can work with the addressbar just like you do with a normal input. Typically you would combine this with something like url-mapper to create your own flexible and custom routing logic.

npm install react-addressbar

var React = require('react');
var Addressbar = require('react-addressbar');

var Test = React.createClass({
  getInitialState: function () {
    return {
      url: '/'
    };
  },
  onChange: function (url) {
    this.setState({
      url: url
    });
  },
  render: function () {
    return (
      <div>
        <Addressbar onChange={this.onChange} value={this.state.url}/>
        <h1>Hello!</h1>
        <a href="/foo">foo</a> <a href="/bar">bar</a>
      </div>
    );
  }
});

React.render(<Test/>, document.body);

When addressbar is used it will by default take full control of the addressbar. If you only want to take control of hash changes, use onlyHash as a property.

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago