Package Exports
- use-lang-direction
- use-lang-direction/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-lang-direction) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
use-lang-direction
A React hook that reads the HTML element's dir
attribute value and any updates to that value allowing you to update your UI accordingly.
In Action
Basic Usage
import React from "react";
import { useLangDirection } from "use-lang-direction";
const App = () => {
const langDir = useLangDirection();
return (
<div >
<input dir={langDir} type="text" />
</div>
);
};
License
MIT