You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
What about defining the components to be used as toasts on the provider? I really doubt you will want to use a different component every time you show a toast. At most I imagine you will want something like info, success, and error. Or if we want to make them dynamic it could be an object with keys as the toast type and the component as the value.
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:
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 anythingThe basic API of the provider is the next one:
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
The text was updated successfully, but these errors were encountered: