Skip to content

useTextDirection ​

Category
Browser

Hook that can get and set the direction of the element

typescript
import { useTextDirection } from '@siberiacancode/reactuse';

Usage ​

typescript
const { value, set, remove } = useTextDirection(elementRef);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetUseTextDirectionTarget-The target element to observe.
initialValue?UseTextDirectionValue'ltr'The initial direction of the element.

Parameters

NameTypeDefaultNote
initialValue?UseTextDirectionValue'ltr'The initial direction of the element.

Contributors ​

Source • Demo