Skip to content

Commit 35e8ec7

Browse files
committed
style: minor refactors #150
1 parent 1d9614b commit 35e8ec7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

ui/src/date_picker.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ export const
5858
const
5959
defaultVal = m.value || null,
6060
parsedVal = defaultVal ? parseDate(defaultVal) : null,
61-
[value, setValue] = React.useState<Date | undefined>(() => {
62-
return parsedVal ? new Date(parsedVal) : undefined
63-
}),
61+
[value, setValue] = React.useState<Date | undefined>(parsedVal ? new Date(parsedVal) : undefined),
6462
onSelectDate = (d: Date | null | undefined) => {
6563
const val = (d === null || d === undefined) ? defaultVal : formatDate(d)
6664
wave.args[m.name] = val

ui/src/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const
195195
components = items.map((m: any, i) => {
196196
const
197197
// All form items are wrapped by their component name (first and only prop of "m").
198-
componentKey = Object.keys(m)[0],
198+
[componentKey] = Object.keys(m),
199199
{ name, visible = true } = m[componentKey],
200200
visibleStyles: React.CSSProperties = visible ? {} : { display: 'none' }
201201

0 commit comments

Comments
 (0)