Skip to content

Commit e279fe2

Browse files
fix: location select not working with react-compiler
1 parent e479a4d commit e279fe2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/app/_home/$school/$year/$id/-location-select.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type Props = {
2626
}
2727

2828
export default function LocationsSelect(props: Props) {
29+
"use no memo"
2930
const { isMobile } = useContext(MobileContext)
3031
const { locations } = props
3132
if (locations.length === 0) return null
@@ -53,8 +54,13 @@ function LocationCombobox({ value, onChange, locations }: Props) {
5354
(l) => l.toLowerCase() === value.toLowerCase()
5455
)
5556

57+
function handleOpen(v: boolean) {
58+
setOpen(v)
59+
console.log(v, open)
60+
}
61+
5662
return (
57-
<Popover open={open} onOpenChange={setOpen}>
63+
<Popover open={open} onOpenChange={handleOpen}>
5864
<PopoverTrigger asChild>
5965
<Button variant="outline" className="justify-start">
6066
{selected ? capitaliseWords(selected) : "Seleziona una sede..."}
@@ -72,7 +78,7 @@ function LocationCombobox({ value, onChange, locations }: Props) {
7278
key={location}
7379
onSelect={(value) => {
7480
onChange(value)
75-
setOpen(false)
81+
// setOpen(false)
7682
}}
7783
>
7884
{capitaliseWords(location)}

0 commit comments

Comments
 (0)