From 5f97e9324b34f29fb815898441ce026cfe2fda6f Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 1 Jan 2017 22:08:02 -0600 Subject: [PATCH] Refactor to use pure function. --- .../assets/js/components/Purpose.jsx | 39 ++++++++++--------- .../assets/js/components/SignIn.jsx | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/bikeshop_project/assets/js/components/Purpose.jsx b/bikeshop_project/assets/js/components/Purpose.jsx index 5070157..040291e 100644 --- a/bikeshop_project/assets/js/components/Purpose.jsx +++ b/bikeshop_project/assets/js/components/Purpose.jsx @@ -1,21 +1,24 @@ +import React, { PropTypes } from 'react'; import MenuItem from 'material-ui/MenuItem'; -import React from 'react'; import SelectField from 'material-ui/SelectField'; -export default class Purpose extends React.Component { - render() { - return ( - - - - - - - - ); - } -} +const Purpose = ({ initialValue, handleChange }) => ( + + + + + + + +); + +Purpose.propTypes = { + initialValue: PropTypes.string, + handleChange: PropTypes.func, +}; + +export default Purpose; diff --git a/bikeshop_project/assets/js/components/SignIn.jsx b/bikeshop_project/assets/js/components/SignIn.jsx index 4cf6246..f2d0492 100644 --- a/bikeshop_project/assets/js/components/SignIn.jsx +++ b/bikeshop_project/assets/js/components/SignIn.jsx @@ -134,7 +134,7 @@ export default class SignIn extends React.Component {