Skip to content

Instantly share code, notes, and snippets.

View drewandre's full-sized avatar

Drew André drewandre

View GitHub Profile
@pete-murphy
pete-murphy / Toggle.js
Last active January 21, 2019 15:41
Simple SVG Toggle in React
import React, { Component } from "react"
export default class Toggle extends Component {
static defaultProps = {
on: false,
onClick: () => {},
colors: {
on: "tomato",
off: "whitesmoke",
fill: "white",
@andrewprogers
andrewprogers / reactRailsTestSetup.md
Last active October 9, 2018 23:26
Setting up A new React on Rails app with webpacker and full test suite

React on Rails with Test Suite (Karma, Jasmine, Enzyme, PhantomJS)

The steps included here detail the steps I followed to get a new React on Rails app set up, with a focus on testing JS components with Karma / Jasmine / Enzyme. A lot of this was liberally borrowed / modified from the Launch Academy curriculum, but there are some additional steps involved to get everything working with webpacker:

Unless otherwise specified, run the code in the terminal

Install Rails with Webpacker configured for React:

rails new project-name
cd project-name