Skip to content

Instantly share code, notes, and snippets.

View brownsmith's full-sized avatar

Paul Brownsmith brownsmith

  • Camberley, Surrey
View GitHub Profile
https://medium.com/dailyjs/techniques-for-decomposing-react-components-e8a1081ef5da
@brownsmith
brownsmith / ReactComponent.js
Created June 28, 2017 07:18
Stateless functional component in React
import PropTypes from 'prop-types';
import React from 'react';
import styles from './Component.scss';
const ComponentName = ({ prop, anotherProp, functionFromContainer, propsAreFromContainer, prop2 }) => {
const someConstant = constantVal;
const componentClickEvent = () => {
// do whatever, perhaps with someConstant;
};
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import styles from './Styles.scss';