Это индексный файл js.
import React from "react";
import { render } from "react-dom";
import {Router, Route, browserHistory} from "react-router";
import {EmployeeList} from "./employeeList";
import {EditForm} from "./edit";
class App extends React. Component{
render(){
return (
<Router history={browserHistory}>
<Route path={"/"} component={EmployeeList} />
</Router>
);
}
}
render(<App />, window.document.getElementById("app"));
Это файл employeeList js.
import React from "react";
export class EmployeeList extends React. Component {
constructor(props) {
super(props);
};
render() {
return (
<div>
<h2>Basic Table</h2>
<table class="table table-dark table-striped">
<thead>
<tr>
<th>Id</th>
<th>First Name</th>
<th>Last Name</th>
<th>Button</th>
</tr>
</thead>
{student}
</table>
</div>
);
}
}
Главная страница - это index.js с этой страницы, которую я хочу вызвать employeeList page..butон показывает неопределенный тип местоположения error.install npm response-route, но он все еще не работает .. невозможно обнаружить ошибку.