/auth
Search
K
Comment on page

mountDropDown

This function renders the DropDown component in the provided Div.

Usage

import React, { useEffect, useRef } from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const MountDropDown = () => {
const dropdownDiv = useRef<HTMLDivElement>(null);
const { mountDropDown } = useSlashAuth();
useEffect(() => {
if (dropdownDiv.current) {
mountDropDown(dropdownDiv.current);
}
}, []);
return <div ref={dropdownDiv}></div>;
};

Return Value

void

Configuration

node

Pass in the div that we should mount the dropdown to.
import React, { useEffect, useRef } from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const MountDropDown = () => {
const dropdownDiv = useRef<HTMLDivElement>(null);
const { mountDropDown } = useSlashAuth();
useEffect(() => {
if (dropdownDiv.current) {
mountDropDown(dropdownDiv.current);
}
}, []);
return <div ref={dropdownDiv}></div>;
};type
Last modified 10mo ago