From 3300182713cdc832dbc40dcb0d4adea1fba58a11 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 17 Jun 2020 18:28:15 +1100 Subject: [PATCH] Converted a stray test project component to functional --- .../basic/custom-fields/Stars/views/Field.js | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/test-projects/basic/custom-fields/Stars/views/Field.js b/test-projects/basic/custom-fields/Stars/views/Field.js index 01d1f6e0502..fc548c8ba8e 100644 --- a/test-projects/basic/custom-fields/Stars/views/Field.js +++ b/test-projects/basic/custom-fields/Stars/views/Field.js @@ -3,23 +3,22 @@ import React from 'react'; import { FieldContainer, FieldLabel, FieldInput } from '@arch-ui/fields'; import Stars from './Stars'; -export default class StarsField extends React.Component { - handleChange = newValue => { - this.props.onChange(newValue); +const StarsField = ({ field, value, errors, onChange }) => { + const handleChange = newValue => { + onChange(newValue); }; - render() { - const { field, value, errors } = this.props; - const { starCount } = field.config; - const htmlID = `ks-input-${field.path}`; + const { starCount } = field.config; + const htmlID = `ks-input-${field.path}`; - return ( - - - - - - - ); - } -} + return ( + + + + + + + ); +}; + +export default StarsField;