Made a draft notification sidebar and the following code returns no warning/error in console but solid component don't re-render!
---
import { AlertList } from '../components/alert';
---
<ul class="bg-[black] bg-opacity-20 h-screen w-72 sm:w-96 absolute right-0 top-0 z-40 text-white">
<AlertList client:only="solid-js" />
</ul>
<script>
import { toggleNotification } from "./alert";
await (new Promise(resolve => setTimeout(resolve, 1000)));
toggleNotification();
console.log("Notification toggled");
</script>
import { atom } from 'nanostores';
import { useStore } from '@nanostores/solid'
const NotificationToggle = atom<boolean>(true);
export function toggleNotification() {
NotificationToggle.set(false);
}
export function AlertList() {
const $notifications = useStore(NotificationToggle);
console.log($notifications());
return $notifications() ? (<li class={"bg-[red]"}>A TEMPLATE ALERT</li>) : null
}
It should disappear 1 sec after loading but doesn't. I don't know what to do