Browse Source

chore: Setup basic core interfaces.

master
Denis Thiessen 7 months ago
parent
commit
0606b8e32a
  1. 25
      src/App.js
  2. 5
      src/index.js
  3. 14
      src/interfaces/DataComponent.jsx
  4. 7
      src/interfaces/ResetableComponent.jsx

25
src/App.js

@ -1,24 +1,13 @@
import logo from './logo.svg';
import './App.css';
import React from "react"
import { Route, Switch } from "react-router-dom"
import InfoPage from "./component/InfoPage.jsx"
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<Switch>
<Route exact path="/:info" component={InfoPage} />
</Switch>
);
}

5
src/index.js

@ -3,11 +3,14 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter } from "react-router-dom";
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
);

14
src/interfaces/DataComponent.jsx

@ -0,0 +1,14 @@
import ResetableComponent from "./ResetableComponent.jsx";
export default class DataComponent extends ResetableComponent {
constructor(componentId) {
super();
this.compId = componentId;
}
exportData() {}
getId() { return this.compId; }
}

7
src/interfaces/ResetableComponent.jsx

@ -0,0 +1,7 @@
import React from 'react';
export default class ResetableComponent extends React.Component {
reset() {}
}
Loading…
Cancel
Save