@azrico/url
v1.4.26
Published
Url handler for react native web
Downloads
86
Readme
@azrico/url
Url handler for react native web
Install
yarn add @azrico/url
Usage
import {goToUrl, updateUrlParameter, PathButton} from "deus-url";
import {UrlChangeHandler, UrlStore} from "deus-url";
class Example extends Component {
render() {
return <div>
<PathButton page="customers" />
<PathButton page="vendors" />
<PathButton page="settings" />
</div>; //go to this page (set value of page in query string)
}
}
class Core extends Component {
//using one UrlChangeHandler at top of your app will let you do this :
const current_page = UrlStore.useState((s) => s.current_page);//current page (value of page in query string)
render() {
return <UrlChangeHandler>{/* rest of the app */}<UrlChangeHandler/>;
}
}
List of functions
pageUpdated
reloadPage
gotoNewPath
gotoPath
goToUrl
setUrlParameter
setUrlHash
usePath
useUrlHash
getUrlHash
setUrlPath
modifyUrlParameter