JavaScript
1
Вклад в тег
import React, { Component } from "react";
import FirstPageComponent from "./FirstPageComponent.js";
import SecondPageComponent from"./SecondPageComponent";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
function App (){
return(
<Router>
<div className="App">
<Route path="/" exact exact component={FirstPageComponent}
}/>
<Route path="/second" exact component={SecondPageComponent}/>
</div>
</Router>
)
}
export default App;
import React from "react";
import ReactDOM from "react-dom";
class OnSecondPageButton extends React.Component {
onclick () {
window.location.assign('http://localhost:3000/second/');
}
render() {
return (<a onClick={(e) => this.onclick(e)}><i className="fas fa-chart-bar"></i></a>);
}
}
export default Statistics_button;
import React from "react";
import ReactDOM from "react-dom";
class Back_button extends React.Component {
onclick () {
window.location.assign('http://localhost:3000/');
}
render() {
return (<button onClick={(e) => this.onclick(e)}>Back </button>);
}
}
export default Back_button;