opened
RWOverdijk
username_0
I've been playing around with this module a bit and so far it works really well. There's one thing that's bothering me though.. That's the name property. It looks like it's up to the initiator of the view to decide what the name of the view should be. For instance, on line 45 of HomePage.js in the twitter example:

```javascript
{
  goToTweet: function(tweetData) {
    this.props.toRoute({
      name: "Tweet",
      component: TweetPage,
      data: tweetData
    });
  }
}
```

The name is being defined there. What if the app has several places that initiate this? Would I have to add this all over the place? Can it be defined from within the page view itself, too?
Defining the name of a page
issue
created
allenhartwig
username_1
You could accomplish this like so:
```js
{
  goToTweet: function(tweetData) {
    var TweetPage = require('./pages/tweet')';
    this.props.toRoute({
      name: TweetPage.title,
      component: TweetPage.component,
      data: tweetData
    });
  }
}
```
with pages/tweet.js exporting:
```js
module.exports = {
   title: 'Tweet',
   component: myTweetComponent
};
```
comment
created
allenhartwig
username_1
Alternatively this works as well:
```js
{
  goToTweet: function(tweetData) {
    var TweetPage = require('./pages/tweet')';
    this.props.toRoute({
      name: TweetPage.displayName,
      component: TweetPage,
      data: tweetData
    });
  }
}
```

Just ensure you have the displayName property defined to your desired title on within your `React.createClass`.
comment
closed
RWOverdijk
username_0
issue
created
RWOverdijk
username_0
Satisfying enough. Thanks.
comment