Archives : November-2016

Resume: I need to run React Router without wepback or similar tools. Directly from CDN links, but I’m stuck with some require.js error. I’m starting to build my first App with React and I’m struggling with React Router. HTML: <body> <div id=”container”></div> <script src=”https://unpkg.com/[email protected]/dist/react.js”></script> <script src=”https://unpkg.com/[email protected]/dist/react-dom.js”></script> <script src=”https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js”></script> <script src=”https://npmcdn.com/[email protected]/umd/ReactRouter.js”></script> <script type=”text/babel” src=”assets/scripts/03_templates/app.js” charset=”utf-8″></script> </body> ..

Read more

I have this setup in my main.js <Router history={history}> <Route path="/" component={Window}> <IndexRoute component={Users} /> <Route path="users" component={Users}> <Redirect from="add" to="edit" /> <Route path="edit(/:id)" component={UserEdit} /> </Route> <Route path="groups" component={Groups} /> <Route path="permissions" component={Permissions} /> <Route path="*" component={Error} /> </Route> </Router> If the url changs to users/add or users/edit the UserEdit component is available as ..

Read more

I am using the same component for three different routes: <Router> <Route path=”/home” component={Home} /> <Route path=”/users” component={Home} /> <Route path=”/widgets” component={Home} /> </Router> Is there anyway to combine it, to be like: <Router> <Route path=[“/home”, “/users”, “/widgets”] component={Home} /> </Router> Source: React Router..

Read more