Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const LanguagePickerView: React.FC = ({ selected, available }) => {
const [open, setOpen] = React.useState(false);
const [language, setLanguage] = useDynamicLanguage(selected, loadLanguage);
const container = React.useRef();
const translate = useTranslate();
useOnClickOutside(container, () => setOpen(false));
return (
<div>
<div> setOpen(!open)}>
</div>
<ul>
{available.map(lang => (
<li> setLanguage(lang)}>
<span>{translate(lang)}</span>
</li>
))}
</ul></div>