We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c68bd5 commit c1a3ce6Copy full SHA for c1a3ce6
src/Select.tsx
@@ -50,10 +50,19 @@ export const Select = memo(
50
51
const id = useAnalyticsId({
52
"defaultIdPrefix": "fr-select-group",
53
- "explicitlyProvidedId": id_props ?? nativeSelectProps.id
+ "explicitlyProvidedId": id_props
54
});
55
56
- const selectId = `select-${useId()}`;
+ const selectId = (function useClosure() {
57
+ const id = useId();
58
+
59
+ if (nativeSelectProps.id !== undefined) {
60
+ return nativeSelectProps.id;
61
+ }
62
63
+ return `select-${id}`;
64
+ })();
65
66
const stateDescriptionId = `select-${useId()}-desc`;
67
68
return (
0 commit comments