useTextDirection ​
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
Name | Type | Default | Note |
---|---|---|---|
target | UseTextDirectionTarget | - | The target element to observe. |
initialValue? | UseTextDirectionValue | 'ltr' | The initial direction of the element. |
Returns
Parameters
Name | Type | Default | Note |
---|---|---|---|
initialValue? | UseTextDirectionValue | 'ltr' | The initial direction of the element. |