Commit 917d6f4d authored by Mohammad Javad Ghasemy's avatar Mohammad Javad Ghasemy 🦈

Hello World from React

parent 52b069a7
......@@ -12,4 +12,4 @@ require('./bootstrap');
* or customize the JavaScript scaffolding to fit your unique needs.
*/
require('./components/Example');
require('./components/App');
import React from 'react';
import ReactDOM from 'react-dom';
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import NewBook from './Newbook';
function App() {
return (
<Router>
<Switch>
<Route path="/new-book">
<NewBook />
</Route>
<Route path="/">
<h1>I'm in Home</h1>
</Route>
</Switch>
</Router >
);
}
export default App;
if (document.getElementById('App')) {
ReactDOM.render(<App />, document.getElementById('App'));
}
import React from 'react';
import ReactDOM from 'react-dom';
function Example() {
return (
<div className="container">
<div className="row justify-content-center">
<div className="col-md-8">
<div className="card">
<div className="card-header">Example Component</div>
<div className="card-body">I'm an example component!</div>
</div>
</div>
</div>
</div>
);
}
export default Example;
if (document.getElementById('example')) {
ReactDOM.render(<Example />, document.getElementById('example'));
}
import React from 'react';
export default class NewBook extends React.Component {
constructor(props) {
super(props);
this.props = props;
this.state = {};
}
render() {
return (
<div>
</div>
);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment