imports...
interface Props {}
export const [toastVisibility, setToastVisibility] = createSignal(false);
const handleCloseToast = () => {
setToastVisibility(false);
};
const Toast: Component<Props> = (props) => {
const derivedSignal = () => {
if (toastVisibility()) {
// Test is able to reach this line
console.log("SHOULD BE SHOWING TOAST NOW..............");
console.log("toastVisibility: ", toastVisibility());
// After button click, the signal is True
return toastVisibility();
}
console.log("toastType: ", toastType);
return toastVisibility();
};
return (
<Show when={derivedSignal()} fallback={<>not showing toast</>}>
TOAST SHOWING
</Show>
);
};
export default Toast;
imports...
interface Props {}
export const [toastVisibility, setToastVisibility] = createSignal(false);
const handleCloseToast = () => {
setToastVisibility(false);
};
const Toast: Component<Props> = (props) => {
const derivedSignal = () => {
if (toastVisibility()) {
// Test is able to reach this line
console.log("SHOULD BE SHOWING TOAST NOW..............");
console.log("toastVisibility: ", toastVisibility());
// After button click, the signal is True
return toastVisibility();
}
console.log("toastType: ", toastType);
return toastVisibility();
};
return (
<Show when={derivedSignal()} fallback={<>not showing toast</>}>
TOAST SHOWING
</Show>
);
};
export default Toast;