Hi, I’m new to rails and react on rails. I am trying to make a minimal react on rails app with some routing, but I can’t seem to implement routing at all. I tried studying https://github.com/shakacode/react-webpack-rails-tutorial, and tried studying the javascript version of react router and still have no idea on how to tackle it. The react-webpack-rails-tutorial seems really complicated to a unexperienced person. Can I get some insights?
update :
import React from ‘react’;
import {Router, Route, Link, hashHistory} from ‘react-router’
import {HelloWorld} from ‘…/components/HelloWorld’
const Home = () =>
const About = () =>
const Contact = () =>
export default class Test extends React.Component {
render() {
return (
<Router history={ hashHistory }>
<Route path="/" component={Home}></Route>
<Route path="/about" component={About}></Route>
<Route path="/contact" component={Contact}></Route>
<Route path="/hello" component={HelloWorld}></Route>
</Router>
);
}
}
The code above ALMOST works as I imagined. Home, About, and Contact work in localhost:3000/#/home about and contact. But when I go in #/hello, nothing shows up. HelloWorld is from https://github.com/shakacode/react_on_rails.
@dantzchan any solution you got?
ShakaCoder dont seem to help
@talha @dantzchan This looks like it needs some standard debugging. We’re available to provide individualized help. Please see the ShakaCode coaching plan.
@justin A little help would be appreciated…
Please get in touch with me directly.
I have similar problem, I want to use react_on_rails in connection with redux and router. If you want we can try to solve it on shakacode slack.