chore: replace function expression with inline statement

replace destructuring for better static analysis

remove unused variables
This commit is contained in:
Christian Andolf
2024-11-05 10:14:52 +01:00
parent 28c30b2416
commit f6b3cf8b92
25 changed files with 75 additions and 78 deletions

View File

@@ -34,7 +34,7 @@ export default function CountrySelect({
readOnly = false,
registerOptions = {},
}: CountryProps) {
const { formatMessage } = useIntl()
const intl = useIntl()
const [rootDiv, setRootDiv] = useState<CountryPortalContainer>(undefined)
function setRef(node: CountryPortalContainerArgs) {
@@ -53,13 +53,12 @@ export default function CountrySelect({
setValue(name, country)
}
const selectCountryLabel = formatMessage({ id: "Select a country" })
const selectCountryLabel = intl.formatMessage({ id: "Select a country" })
return (
<div className={`${styles.container} ${className}`} ref={setRef}>
<ComboBox
aria-label={formatMessage({ id: "Select country of residence" })}
className={styles.select}
aria-label={intl.formatMessage({ id: "Select country of residence" })}
isInvalid={fieldState.invalid}
isReadOnly={readOnly}
isRequired={!!registerOptions?.required}