Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error refresh route #2631

Closed
mandado opened this issue Dec 2, 2015 · 1 comment
Closed

Error refresh route #2631

mandado opened this issue Dec 2, 2015 · 1 comment

Comments

@mandado
Copy link

mandado commented Dec 2, 2015

When i click in Link, the page that contains url products/new i can access the page new product and works fine, but if i refresh page returns Uncaught SyntaxError: Unexpected token <.

How i can resolve this ?

page product new

import React from 'react';

class ProductNew extends React.Component{
  constructor(props){
    super(props);
  }
  render(){
    return (
      <div>
        <div><h1>ProductNew</h1></div>
      </div>
    );
  }
}

module.exports = ProductNew;

page products

import React from 'react';
import {Link}  from 'react-router';

class Products extends React.Component{
  constructor(props){
    super(props);
  }
  render(){
    return (
      <div>
        <div><h1>Products</h1></div>
        <Link to="/products/new">new</Link>
      </div>
    );
  }
}

module.exports = Products;

page App

render((
  <Router history={createBrowserHistory()}>
    <Route path="/" component={Layout}>
       <IndexRoute component={Home} />
       <Route path="/products" component={Products}/>
       <Route path="/products/new" component={ProductNew}/>
    </Route>
  </Router>
), document.getElementById('app'));
@taion
Copy link
Contributor

taion commented Dec 2, 2015

Thanks for your question!

We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router.

Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router.

We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46.

@taion taion closed this as completed Dec 2, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants