By default, React doesn't have built in routing. We will add routing to our application with the react-routing-component.
Tried code not working.
Hi
It doesn't look like the complete source code is available here.
the following link might be useful, github.com/STRML/react-router-component/issues/32; But I cannot fix the error. Could someone at egghead look into this please , I really enjoy these videos and want to learn more about routing
And yes I am running the source code
OK I found my error, I was being lazy and opening dist/index.html in browser. For anyone else stuck like I was install a command line server e.g. npm install --save-dave http-server ( or one of your choice) cd to dist directory at prompt type 'http-server' to start server should listen on port 8080 In browser go to http://localhost:8080
Awesome, and thank you. I can only guess how many hours this saved me.
I've been having the same issue as Jason. I followed the lesson step by step and can't get it to serve up. I get this:
Uncaught TypeError: Cannot read property 'props' of undefined
from my main.js file
Any help would be awesome. Thx guys!
edit...nevermind. I needed to run the http server from within the dist/ directory so that the urls match the actual routes.
I'm getting the error: Uncaught TypeError: Cannot read property 'ref' of null from main.js:1177 which is in RouteRenderingMixin: props = assign({ref: this.state.match.route.ref}, props);
However, if I comment out the line {this.props.children} in app-template.js, then I don't get any errors, and I can see the Header and CartSummary components are rendered.
Dave you're a star was just about to throw a fit coz I couldn't get this bit to work....
thanks Darren
Thank you- I have been doing the same throughout the tutorials up until now. One thing I haven't been able to figure out though, is why my paths are not matching. Did you run into this as well?
I can't remove my own post, so I might as well post the solution:
I was running http-server from my (project)root folder. Should have started it in the /dist folder.