Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

(React Router) Routes work only once #15

Closed
zemd opened this issue Mar 12, 2015 · 6 comments
Closed

(React Router) Routes work only once #15

zemd opened this issue Mar 12, 2015 · 6 comments
Labels

Comments

@zemd
Copy link

zemd commented Mar 12, 2015

Hi!
I am new to react and trying to figure out with this project, and stucked with a problem when add new route it can be viewed only once.

so added files and new route https://gist.github.com/hunterman/1f46436face225b25425 and then I can transit to any page only once after page loaded, after that page is not rerendering, but only pushState works.

@RickWong
Copy link
Owner

Maybe because you only have name=... but don't have path=... attributes on the <Route> declarations.

@zemd
Copy link
Author

zemd commented Mar 12, 2015

@RickWong thank you for your answer, but as you can see here https://github.com/rackt/react-router/blob/master/examples/transitions/app.js there is no path also, and here https://github.com/rackt/react-router/blob/master/docs/api/components/Route.md here is saying that

The path used in the URL. If left undefined, the path will be defined by the name, and if there is no name, will default to /.

also, why does it work only once? after I open page in browser I can navigate to another page, but after I've navigated I can't make it again.

ps to be sure added paths to routes definition, and it works the same, so not solved the issue

@RickWong
Copy link
Owner

Do you get any console errors (in browser or in your terminal)? I too find it strange that it works just once. What does About.jsx look like?

@RickWong RickWong changed the title Routes work only once (React Router) Routes work only once Mar 12, 2015
@zemd
Copy link
Author

zemd commented Mar 13, 2015

@RickWong no errors, made video https://dl.dropboxusercontent.com/u/19321079/routes.mov

About.jsx is simplest component as it can be

import React from 'react';

const About = React.createClass({
    render() {
        return (
            <div className="container">
                Hello World
            </div>
        );
    }
});


export default About;

@RickWong
Copy link
Owner

Can you log the value that is passed to this.transitionTo(...) each time you click?

@RickWong
Copy link
Owner

Closing issue because the problem isn't likely to be caused by the starterkit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants