FrontEnd: Playing with store (solidjs)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user