valelattanzi--components
v2.2.0
Published
Components for ionic react apps (Hooks, UI Components, Configurations)
Downloads
408
Readme
Usage
Config
EndPointType
// Create your endpoints like this
var myEndPoints: EndPointType[] = [
{
root: "/user",
actions: {
read: {
one: "/read",
all: "/read/all",
},
create: "/create",
update: "/update",
remove: "/remove",
},
},
];
PageType
var pages: PageType[] = [
{
root: "/user",
mode: {
list: "/list",
create: "/create",
read: "/read",
update: "/update",
remove: "/remove",
},
},
];
Custom Hooks
useBackButton
useBackButton(handleGoBack);
function handeGoBack() {
// Here you put your logic when the user uses the back button from the mobile
}
useError
const { showError, errorMessage, showErrorFunction } = useError();
showErrorFunction("Error: something"); // Put the show error on true
return <IonAlert isOpen={showError} message={errorMessage} buttons={["OK"]} />;