Skip to content

Instantly share code, notes, and snippets.

@stephencookdev
stephencookdev / SwitchWithSlide-render.js
Created July 16, 2018 15:12
`SwitchWithSlide` example - render
render() {
const {
prevChild,
curChild,
childPosition,
animationCallback,
} = this.state;
return (
<Slider
@stephencookdev
stephencookdev / App.js
Created July 16, 2018 15:09
`SwitchWithSlide` example
import React from "react";
import { animateSwitch } from "./animateSwitch";
import { SlideOut } from "./SlideOut";
const SwitchWithSlide = animateSwitch(Switch, SlideOut);
export default () => (
<SwitchWithSlide>
<Route path="/a" component={PageA} />
<Route path="/b" component={PageB} />
@stephencookdev
stephencookdev / webpack.config.js
Last active February 18, 2018 23:32
Example webpack config (post SMP)
const ForceCaseSensitivityPlugin = require("force-case-sensitivity-webpack-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
module.exports = smp.wrap({
entry: {
app: ["./app.js"]
},
@stephencookdev
stephencookdev / webpack.config.js
Last active March 5, 2018 11:59
Example webpack config (pre SMP)
const ForceCaseSensitivityPlugin = require("force-case-sensitivity-webpack-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
module.exports = {
entry: {
app: ["./app.js"]
},
output: "./public",
module: {
rules: [