1
0
mirror of https://github.com/mgerb/react-starter synced 2026-01-10 09:02:49 +00:00

convert to typescript - react-router upgrade to 4

This commit is contained in:
2017-03-29 17:09:32 -05:00
committed by Mitchell Gerber
parent eba08b8bc2
commit 0f7a775039
19 changed files with 1145 additions and 1245 deletions

View File

@@ -1,29 +0,0 @@
import React from 'react';
import { Link } from 'react-router';
import './Navbar.scss';
export default class Navbar extends React.Component {
render() {
return (
<div className="Navbar">
<div className="Navbar__header">
<span>React Webpack 2 Seed</span>
<a href="https://github.com/mgerb/react-webpack2-seed">GitHub
<i className="fa fa-github" aria-hidden="true"/>
</a>
</div>
<div className="Navbar__nav">
<Link to="/" className="Navbar__item" onlyActiveOnIndex activeClassName="Navbar__item--active">Home</Link>
<Link to="/new" className="Navbar__item" activeClassName="Navbar__item--active">New</Link>
</div>
</div>
);
}
}
Navbar.propTypes = {
children: React.PropTypes.node,
};

View File

@@ -0,0 +1,38 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
import './Navbar.scss';
interface Props {
}
interface State {
}
export default class Navbar extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
}
render() {
return (
<div className="Navbar">
<div className="Navbar__header">
<span>React Starter</span>
<a href="https://github.com/mgerb/react-webpack2-seed">GitHub
<i className="fa fa-github" aria-hidden="true"/>
</a>
</div>
<div className="Navbar__nav">
<NavLink to="/" className="Navbar__item" exact activeClassName="Navbar__item--active">Home</NavLink>
<NavLink to="/new" className="Navbar__item" exact activeClassName="Navbar__item--active">New</NavLink>
</div>
</div>
);
}
}