Skip to content

Instantly share code, notes, and snippets.

node_modules/
build/
@joshuacrass
joshuacrass / react-flow-element-type-button.jsx
Created September 18, 2018 14:08
react-flow element type button
// @flow
import React from 'react';
import type { Element } from 'react';
type Props = {
children: string,
};
const Button = (props: Props): Element<'button'> => {
const { children } = props;
@joshuacrass
joshuacrass / react-flow-eslint.json
Created September 18, 2018 08:33
react-flow eslint
{
"extends": ["airbnb", "prettier", "prettier/flowtype", "prettier/react"],
"plugins": ["flowtype", "react", "prettier"],
"parser": "babel-eslint",
"rules": {
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", "jsx"]
}
@joshuacrass
joshuacrass / react-flow-app-button.jsx
Last active September 18, 2018 08:18
react-flow app button example
// @flow
import React from 'react';
import { hot } from 'react-hot-loader';
import Button from 'Components/button';
import style from './app.css';
const App = () => {
// define the button text and give it a type of string
const buttonText: string = 'Click Me';
@joshuacrass
joshuacrass / react-flow-button-component.jsx
Last active September 18, 2018 08:07
react-flow button component
// @flow
import React from 'react';
// 'children' is required and must be a string
type Props = {
children: string,
};
const Button = (props: Props) => {
// destructure the children from props
@joshuacrass
joshuacrass / react-flow-config-starter
Last active September 16, 2018 06:40
react-flow flow config starter
[ignore]
[include]
[libs]
[lints]
[options]
@joshuacrass
joshuacrass / react-flow-app.jsx
Created September 16, 2018 06:12
react-flow app.jsx
// @flow
import React from 'react';
import { hot } from 'react-hot-loader';
import Button from 'Components/button';
import style from './app.css';
const App = () => (
<div className={style.app}>
React Starter
<span role="img" aria-label="rocket ship">
@joshuacrass
joshuacrass / react-flow-babelrc
Created September 15, 2018 13:15
react-flow-babel babelrc
{
"presets": ["@babel/preset-env", "@babel/react", "@babel/flow"],
"plugins": ["react-hot-loader/babel"]
}
@joshuacrass
joshuacrass / sas-lint-config-file.yml
Last active September 14, 2018 15:38
sass-lint yaml file
rules:
leading-zero: 0
function-name-format:
- 2
- allow-leading-underscore: false
convention: camelcase
mixin-name-format:
- 2
- allow-leading-underscore: false
convention: camelcase
@joshuacrass
joshuacrass / webpack-scss-app.jsx
Created September 12, 2018 06:20
webpack-scss app.jsx
import React from 'react';
import { hot } from 'react-hot-loader';
import Button from 'Components/button';
import style from './app.scss';
const App = () => (
<div className={style.app}>
React Starter
<span role="img" aria-label="rocket ship">
🚀