Skip to content

Commit 342d370

Browse files
author
Henrik Kubitza
committed
fix: improved code readability
1 parent 017183d commit 342d370

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/time.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ export default class Time extends Component<TimeProps, TimeState> {
253253
};
254254

255255
renderTimeCaption = (): JSX.Element => {
256-
return (this.props.showTimeCaption ?? Time.defaultProps.showTimeCaption) ? (
256+
if (this.props.showTimeCaption === false) {
257+
return <></>;
258+
}
259+
260+
return (
257261
<div
258262
className={`react-datepicker__header react-datepicker__header--time ${
259263
this.props.showTimeSelectOnly
@@ -268,8 +272,6 @@ export default class Time extends Component<TimeProps, TimeState> {
268272
{this.props.timeCaption}
269273
</div>
270274
</div>
271-
) : (
272-
<></>
273275
);
274276
};
275277

0 commit comments

Comments
 (0)