diff options
| author | Haishan <[email protected]> | 2020-05-14 22:50:48 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-05-14 22:50:48 +0800 |
| commit | faf4cba37c8dd123600a62ec4feb39cccd851bcb (patch) | |
| tree | 144bc503428ff891e74684da487f04e2fce90d57 /src/components/Field.js | |
| parent | aceb1b4a365b1d86d66c0538011580eb01270219 (diff) | |
chore: lib classnames -> clsx
Diffstat (limited to 'src/components/Field.js')
| -rw-r--r-- | src/components/Field.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/Field.js b/src/components/Field.js index 8041a3b..fd5b0d3 100644 --- a/src/components/Field.js +++ b/src/components/Field.js @@ -1,14 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import cx from 'classnames'; +import cx from 'clsx'; import s from './Field.module.css'; const { useCallback } = React; export default function Field({ id, label, value, onChange, ...props }) { - const valueOnChange = useCallback(e => onChange(e), [onChange]); + const valueOnChange = useCallback((e) => onChange(e), [onChange]); const labelClassName = cx({ - [s.floatAbove]: typeof value === 'string' && value !== '' + [s.floatAbove]: typeof value === 'string' && value !== '', }); return ( <div className={s.root}> @@ -25,5 +25,5 @@ Field.propTypes = { type: PropTypes.oneOf(['text', 'number']), onChange: PropTypes.func, id: PropTypes.string, - label: PropTypes.string + label: PropTypes.string, }; |
