Rafał Warzycha
@rwarzycha
With Create React App
https://hackernoon.com/reactjs-component-lifecycle-methods-a-deep-dive-38275d9d13c0
https://scotch.io/tutorials/getting-to-know-flux-the-react-js-architecture
import React from "react";
import { render } from "react-dom";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import About from "./components/About";
import Home from "./components/Home";
import Topics from "./components/Topics";
const BasicExample = () =>
<Router>
<div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">About</Link>
</li>
<li>
<Link to="/topics">Topics</Link>
</li>
</ul>
<hr />
<Route exact path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/topics" component={Topics} />
</div>
</Router>;
render(<BasicExample />, document.getElementById("root"));
import React from 'react';
import { render } from 'react-dom';
import Hello from './Hello';
const styles = {
fontFamily: 'sans-serif',
textAlign: 'center'
};
class App extends React.Component {
componentDidMount() {
console.log(this.refs);
}
render() {
return (
<div style={styles}>
<Hello name="CodeSandbox" />
<h2 ref="ref">Start editing to see some magic happen {'\u2728'}</h2>
</div>
);
}
}
render(<App />, document.getElementById('root'));