-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
V0.1 releaseWill be included in V0.1 releaseWill be included in V0.1 releaseenhancementNew feature or requestNew feature or requesthacktoberfest
Description
Description
We need to implement the basic hook to render a component passed as a param on an absolute position.
According to primary research about how to render on the virtual DOM root, we need to provide an app wrapper (Provided) to distinct the absolute position of the screen.
The basic API of the hook is the next one:
const {onOpen, onClose} = useToast (<CustomToastComponent />);
In which:
useToast
is a hook invokes in whatever component inside the apponOpen
is a handler function that when is invoked, shows<CustomToastComponent />
in a fixed position (for now)onClose
is a handler function that when is invoked remove<CustomToastComponent />
from the app if it was shown, in another case, it doesn't anything
The basic API of the provider is the next one:
<ToastProvider>
<App />
<ToastProvider />
In which:
App
is the applicationToastProvider
is a provider that allowsuseToast
hook to show the custom component from anywhere in the application.
** Additional context **
To implementing the Provider component, is recommended use Context API
Metadata
Metadata
Assignees
Labels
V0.1 releaseWill be included in V0.1 releaseWill be included in V0.1 releaseenhancementNew feature or requestNew feature or requesthacktoberfest