Not working, not working

I am using React 0.14.0, React Router 2.0.0-rc4, browser 11.2.0, babelify 7.2.0.

Here is my router code:

render((
<Router history={browserHistory}>
  <Route path="/" component={App}>
    <IndexRoute component={Departments} />
    <Route path="goals" component={Goals} />
    <Route path="departments" component={Departments} >
      <Route path="department" component={Department} />
    </Route>
  </Route>
</Router>
), document.getElementById('react-container'))

root / department works fine, but not root / department /. root / department / department does not work either. I'm not sure why.

It also seems that any parameter matters: myParam is not recognized.

I do not see any difference between my code and the examples given in the documentation.

Another weird thing: I have no warning:

Warning: [react-router] Location "undefined" did not match any routes

I have:

Uncaught SyntaxError: Unexpected token <        bundle.js:2

And if I click on the bundle.js link in the chrome dev tools, I come in index.html (but bundle.js is the name of the tab).

Major routes, such as /, departments and goals, work fine.

I'm kinda stuck on this. Any advice would be helpful.

: https://github.com/codeforabq/Open-Budget-ABQ/tree/dev
.

+4
2

'root/department/department' .

- "". "App".

, "root/department/department" , "department" .

, :

<Router history={browserHistory}>
  <Route path="/" component={Departments}>
    <IndexRoute component={Goals} />
      <Route path="department" component={Department} />
    </Route>
  </Route>
</Router>
Hide result
+1

. .

URL /. :

Error: Invalid value for <path> attribute d="M2.4492935982947065e-15,-40A40,40 0 1,1 NaN,NaNL0,0Z"

http://localhost:3000/departments/ http://localhost:3000/departments/department

.

php- (php -S localhost: 3000), :

GET http://localhost:3000/departments/app/data/budget-first-test.tsv 404 (Not Found)
Uncaught #<XMLHttpRequest>

, app.jsx :

var dataPath = 'app/data/budget-first-test.tsv';

var dataPath = '/app/data/budget-first-test.tsv'; 

! .

!

+1

Source: https://habr.com/ru/post/1624041/


All Articles