Skip to content

Commit 6b3fdee

Browse files
committed
[refactor] Fix formatting
1 parent b22ae10 commit 6b3fdee

2 files changed

Lines changed: 7 additions & 23 deletions

File tree

packages/@mantine/dates/src/components/DateTimePicker/DateTimePicker.test.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,7 @@ describe('@mantine/dates/DateTimePicker', () => {
170170
};
171171

172172
render(
173-
<DateTimePicker
174-
{...defaultProps}
175-
classNames={classNames}
176-
placeholder="test-placeholder"
177-
/>
173+
<DateTimePicker {...defaultProps} classNames={classNames} placeholder="test-placeholder" />
178174
);
179175

180176
expect(screen.getByText('test-placeholder')).toHaveClass('test-placeholder-class');

packages/@mantine/hooks/src/use-list-state/use-list-state.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ export type UseListStateReturnValue<T> = [T[], UseListStateHandlers<T>];
2525
export function useListState<T>(initialValue: T[] | (() => T[]) = []): UseListStateReturnValue<T> {
2626
const [state, setState] = useState(initialValue);
2727

28-
const append = useCallback(
29-
(...items: T[]) => setState((current) => [...current, ...items]),
30-
[]
31-
);
28+
const append = useCallback((...items: T[]) => setState((current) => [...current, ...items]), []);
3229

33-
const prepend = useCallback(
34-
(...items: T[]) => setState((current) => [...items, ...current]),
35-
[]
36-
);
30+
const prepend = useCallback((...items: T[]) => setState((current) => [...items, ...current]), []);
3731

3832
const insert = useCallback(
3933
(index: number, ...items: T[]) =>
@@ -123,22 +117,16 @@ export function useListState<T>(initialValue: T[] | (() => T[]) = []): UseListSt
123117
);
124118

125119
const applyWhere = useCallback(
126-
(
127-
condition: (item: T, index: number) => boolean,
128-
fn: (item: T, index?: number) => T
129-
) =>
120+
(condition: (item: T, index: number) => boolean, fn: (item: T, index?: number) => T) =>
130121
setState((current) =>
131122
current.map((item, index) => (condition(item, index) ? fn(item, index) : item))
132123
),
133124
[]
134125
);
135126

136-
const filter = useCallback(
137-
(fn: (item: T, i: number) => boolean) => {
138-
setState((current) => current.filter(fn));
139-
},
140-
[]
141-
);
127+
const filter = useCallback((fn: (item: T, i: number) => boolean) => {
128+
setState((current) => current.filter(fn));
129+
}, []);
142130

143131
const handlers = useMemo(
144132
() => ({

0 commit comments

Comments
 (0)