Skip to content

Commit ff5b7a7

Browse files
committed
simplify code
1 parent 2ee122b commit ff5b7a7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Search/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const Search = React.forwardRef(
5757
<Icon type="times" />
5858
</button>
5959
<hx-search></hx-search>
60-
{typeof label === 'undefined' && (
60+
{label && (
6161
<label
6262
className={classnames({
6363
hxOptional: optional,

src/Select/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Select = React.forwardRef(
1313
{children}
1414
</select>
1515
<hx-select></hx-select>
16-
{typeof label === 'undefined' && (
16+
{label && (
1717
<label
1818
className={classnames({
1919
hxOptional: optional,

src/Text/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Text = React.forwardRef(
1414
ref={ref}
1515
>
1616
<input {...rest} id={id} required={required} type="text" />
17-
{typeof label === 'undefined' && (
17+
{label && (
1818
<label
1919
className={classnames({
2020
hxOptional: optional,

src/TextArea/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const TextArea = React.forwardRef(
1414
ref={ref}
1515
>
1616
<textarea {...rest} id={id} required={required} disabled={disabled} />
17-
{typeof label === 'undefined' && (
17+
{label && (
1818
<label
1919
className={classnames({
2020
hxOptional: optional,

0 commit comments

Comments
 (0)