Comments (13)
change name="about/us"
to path="about/us"
from reactgo.
@choonkending possibly worth changing all the routes to use path? I'm not sure of the purpose of name in routes
from reactgo.
@psimyn Ah yes! How stupid of me! Thanks
from reactgo.
@psimyn Thanks. Had a look Route API. I'll give it a test tomorrow. Definitely worth changing.
from reactgo.
@psimyn @choonkending Seems that there is an issue on refresh, for example if I have <Route name="about" path="about/us" handler={About} />
and I go to the page from the nav bar it works, but if I was to go to the page directly http://localhost:3000/about/us I'd get the following errors:
Warning: No route matches path "/about/us". Make sure you have <Route path="/about/us"> somewhere in your routes Warning: No route matches path "/about/assets/styles/main.css". Make sure you have <Route path="/about/assets/styles/main.css"> somewhere in your routes Warning: No route matches path "/about/assets/app.js". Make sure you have <Route path="/about/assets/app.js"> somewhere in your routes
from reactgo.
@joshhornby check your path again :)
missing leading slash
from reactgo.
<Route name="about" path="/about/us" handler={About} />
Same error.
Warning: No route matches path "/about/assets/styles/main.css". Make sure you have <Route path="/about/assets/styles/main.css"> somewhere in your routes Warning: No route matches path "/about/assets/app.js". Make sure you have <Route path="/about/assets/app.js"> somewhere in your routes
from reactgo.
This seems like an issue with react router not finding the correct handler
on the server. Might because the name is different from path.
Also could you try pulling the latest changes? The other warnings should
not appear now because I fixed the source map issue.
On Fri, 24 Jul 2015 18:33 Josh Hornby [email protected] wrote:
Same error.
Warning: No route matches path "/about/assets/styles/main.css". Make sure
you have somewhere in your
routes
Warning: No route matches path "/about/assets/app.js". Make sure you have
somewhere in your routesβ
Reply to this email directly or view it on GitHub
#40 (comment)
.
from reactgo.
Also is there a reason why you have /about/us? It normally suggests that
there is a nested route.
I would normally name it /about-us :)
On Fri, 24 Jul 2015 18:54 choon ken ding [email protected] wrote:
This seems like an issue with react router not finding the correct handler
on the server. Might because the name is different from path.Also could you try pulling the latest changes? The other warnings should
not appear now because I fixed the source map issue.On Fri, 24 Jul 2015 18:33 Josh Hornby [email protected] wrote:
Same error.
Warning: No route matches path "/about/assets/styles/main.css". Make sure
you have somewhere in your
routes
Warning: No route matches path "/about/assets/app.js". Make sure you have
somewhere in your routesβ
Reply to this email directly or view it on GitHub
#40 (comment)
.
from reactgo.
@choonkending Just an example to illustrate to bug more than anything.
from reactgo.
Ahh I see. Lol sorry about that. I thought I should call that out in case
you were doing that in production hehe.
I'll try to replicate your issue later and give you feedback
On Fri, 24 Jul 2015 19:00 Josh Hornby [email protected] wrote:
@choonkending https://github.com/choonkending Just an example to
illustrate to bug more than anything.β
Reply to this email directly or view it on GitHub
#40 (comment)
.
from reactgo.
<Route name="about" path="/about/us" handler={About} />
shouldn't have a problem. I don't think the issue is this. I used <Route name="about" path="about/us" handler={About} />
and it worked for me.
I could access the page, but I needed to put a leading slash in my src
in base.html
<script type="text/javascript" charset="utf-8" src="/assets/app.js"></script>
Also needed to change "rel": "stylesheet", "href": "/assets/styles/main.css"
in helmconfig.js
.
^^ Those two will be fixed in the CSS Modules PR that will be merged soon-ish :)
@psimyn I read a bit more in router docs - this section.
We need the name
in Route for <Link to="name"></Link>
. Also makes more sense for semantic reasons.
Also, react-router beta is out! Rejoice!
from reactgo.
Perfect this seemed to fix it π thanks @choonkending
from reactgo.
Related Issues (20)
- webpack config file preload all different environment configs.
- Failed to serialize user into session when using MYSQL with Node and Passport. URGENT
- Easy deployment question HOT 4
- Postgres DB on port other than 5432 HOT 2
- New release / update changelog and publish to npm
- Remove usage of css @apply HOT 2
- Consider bundle size limits for vendor packages
- Close / Update old / rotten PRs
- Update all npm packages HOT 2
- Please re-install nodemon HOT 1
- Use hooks HOT 2
- Consider using easy-peasy on top of Redux HOT 1
- Do not bundle server application (Using Node.JS v. 9 with modules support) HOT 1
- [QUESTION] Where I can find the CI service? HOT 2
- Signup error when using CORS HOT 2
- Introducing immer
- Introducting TypeScript
- postcss-cssnext deprecated HOT 1
- Use react-router v5
- leadme νκΈ κ³΅μλ¬Έμ λ§ν¬
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactgo.