React router adds request to url

React router seems to add the request to the end of my routes. The application is served by the node server on which the express is running. I am using the latest version of the jet router "1.0.0-rc1"

Example: http://localhost:8080/#/users?_k=8wsy62

Two questions

1) Why is this happening?

2) How can I stop it when adding a request to a URL?

Here is the code that I still have:

var React = require('react');
var ReactRouter = require('react-router');
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var Link = ReactRouter.Link;
var IndexRoute = ReactRouter.IndexRoute;

var App = React.createClass({
    render: function() {
        return (
            <div className="app">
                <h1>App</h1>
                <Link to="/users">Users</Link>
                {this.props.children}
            </div>
        );
    }
});

var Home = React.createClass({
    render: function() {
        return (
            <div className="home">
                <h2>Home</h2>
            </div>
        );
    }
});

var Users = React.createClass({
    render: function() {
        return (
            <div className="users">
                <h2>Users</h2>
            </div>
        );
    }
});

React.render((
    <Router>
        <Route path="/" component={App}>
            <IndexRoute component={Home} />
            <Route path="users" component={Users} />
        </Route>
    </Router>
), document.body);
+4
source share
1 answer

Taken from this link: http://rackt.imtqy.com/history/stable/HashHistoryCaveats.html

HTML5 pushState popstate, - , - URL. , , , - _k = 123abc. , window.sessionStorage .

, , : https://github.com/rackt/react-router/issues/1952#issuecomment-140401701

+3

Source: https://habr.com/ru/post/1609391/


All Articles