Skip to content

Commit 3c9f84b

Browse files
committed
fixup!
1 parent 82ef634 commit 3c9f84b

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

apps/site/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const pathnameToFilename = new Map<string, string>();
2727
* Normalizes a path to always use forward slashes
2828
*/
2929
const normalizePath = (path: string): string =>
30-
normalize(path).replace(/\\/g, '/').replace(/^\.\//, '');
30+
normalize(path).replace(/\\/g, '/').replace(/^\./g, '');
3131

3232
/**
3333
* Normalizes a filename into a pathname by removing file extensions and index suffixes

packages/ui-components/src/Common/Select/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
44
import * as SelectPrimitive from '@radix-ui/react-select';
55
import classNames from 'classnames';
6-
import { useEffect, useId, useMemo, useState } from 'react';
6+
import { useId, useMemo, useState } from 'react';
77

88
import Skeleton from '#ui/Common/Skeleton';
99
import { isStringArray, isValuesArray } from '#ui/util/array';
@@ -63,8 +63,6 @@ const Select = <T extends string>({
6363
const id = useId();
6464
const [value, setValue] = useState(defaultValue);
6565

66-
useEffect(() => setValue(defaultValue), [defaultValue]);
67-
6866
const mappedValues = useMemo(() => {
6967
let mappedValues = values;
7068

@@ -118,10 +116,7 @@ const Select = <T extends string>({
118116
))}
119117
</SelectPrimitive.Group>
120118
));
121-
// We explicitly want to recalculate these values only when the values themselves changed
122-
// This is to prevent re-rendering and re-calcukating the values on every render
123-
// eslint-disable-next-line react-hooks/exhaustive-deps
124-
}, [JSON.stringify(values)]);
119+
}, [mappedValues]);
125120

126121
// Both change the internal state and emit the change event
127122
const handleChange = (value: T) => {

0 commit comments

Comments
 (0)