Skip to content

Instantly share code, notes, and snippets.

View charly-palencia's full-sized avatar

charly palencia charly-palencia

View GitHub Profile
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
$ nvm install lts/dubnium
curl -L resolve-node.now.sh/lts
import GlobalStyles from "./globalStyles";
...
function App() {
return (
<AppContainer>
<GlobalStyle/>
...
</AppContainer>
);
}
import GlobalStyles from "./globalStyles";
...
function App() {
return (
<AppContainer>
<GlobalStyle/>
...
</AppContainer>
);
}
import React from "react";
const Home = () => (
<h1>
Hi from Home Page!
</h1>
);
export default Home;
@charly-palencia
charly-palencia / components-with-link.js
Created June 14, 2019 04:11
Update styled components using Link router component
import { BrowserRouter as Router, Route } from "react-router-dom";
import Home from "./pages/Home";
<Router>
<Header>
...
<StyledLink to="/home">Home page</StyledLink>
<StyledLink to="/">Index page</StyledLink>
<Route path="/home" exact component={Home} />
</Header>
import { createBrowserHistory } from "history";
const history = createBrowserHistory();
export default history;
import { combineReducers } from "redux";
import { connectRouter } from "connected-react-router";
import history from "../history";
export default combineReducers({
router: connectRouter(history)
});