FrontEnd: Playing with store (solidjs)

This commit is contained in:
2022-09-09 10:39:19 +02:00
parent 637dfb45d8
commit d527500034
7 changed files with 169 additions and 23 deletions

View File

@@ -1,11 +1,20 @@
import type { Component } from "solid-js";
import { Component, Show } from "solid-js";
import { useAuthState } from "../../../context/AuthContext";
const Home: Component = () => {
return (
<div>
<h2>Home</h2>
</div>
)
}
const authState: any = useAuthState();
export default Home;
return (
<div>
<p>Home</p>
<Show when={authState?.isAuthenticated}>
<div>
<p>{JSON.parse(authState?.currentUser)}</p>
</div>
</Show>
</div>
);
};
export default Home;