@riseact/app-portal
v1.0.0
Published
React components and utils to communicate with Riseact from your frontend
Downloads
15
Keywords
Readme
@riseact/app-portal
React components and utils to communicate with Riseact from your frontend
Installation
npm install @riseact/app-portal
yarn add @riseact/app-portal
Usage
import { usePortalToast } from "@riseact/app-portal"
function ToastButton() {
const toast = usePortalToast()
function handleClick = () => {
toast.success("This is rendered by Riseact!")
}
return (
<button onClick={handleClick}>
Click me
</button>
)
}
import { NavbarMenu } from "@riseact/app-portal"
import { useNavigate } from "react-router-dom"
function Page({ children }) {
const navigate = useNavigate()
return (
<div>
<NavbarMenu>
<MenuItem onClick={() => navigate("/home")}>Home</MenuItem>
<MenuItem onClick={() => navigate("/about")}>About</MenuItem>
</NavbarMenu>
{children}
<div>
)
}
License
MIT © Metadonors