We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So I have added the "authentication" as shown in the docs And it is working fine. But the click events not working on the button.
Auth.js
import { clearSession, getSession, useSession } from "vinxi/http"; export async function createSession() { "use server"; return await useSession({ password: "SomeTokenButIDontKnowForWhatSomeTokenButIDontKnowForWhatSomeTokenButIDontKnowForWhat", cookie: { secure: false, httpOnly: true, }, }); } export async function readSession() { "use server"; return await getSession({ password: "SomeTokenButIDontKnowForWhatSomeTokenButIDontKnowForWhatSomeTokenButIDontKnowForWhat", }); } export async function deleteSession() { "use server"; return await clearSession(); }
User.jsx
import { createAsync, query, redirect } from "@solidjs/router"; import { readSession } from "~/backend/auth"; const getUser = query(async () => { "use server"; const session = await readSession() if (!session?.data?.email) { throw redirect("/log-in"); } return { email: session.data.email } }) export default function User(props) { const user = createAsync(() => getUser(), { deferStream: true }); const handleClick = ()=>{ console.log('button clicked') } return ( <div> <div class="sf-my-container"> <h1>Hello,</h1> <h2>{user()?.email}</h2> <button onClick={handleClick}>Click me</button> </div> {props.children} </div> ) }
If i only keep the following version of User.jsx it still doesn't work.
import { createAsync, query, redirect } from "@solidjs/router"; import { readSession } from "~/backend/auth"; export default function User(props) { const handleClick = ()=>{ console.log('button clicked') } return ( <div> <div class="sf-my-container"> <h1>Hello,</h1> <button onClick={handleClick}>Click me</button> </div> {props.children} </div> ) }
But as soon as i remove "readSession" import , the click event starts working.
The text was updated successfully, but these errors were encountered:
So I was using solidstart 1.0.10 and now I upgraded it latest version and the problem seems to be resolved.
Sorry, something went wrong.
@ankurpowar Is it alright if I close this issue then?
Yes, Please.
No branches or pull requests
So I have added the "authentication" as shown in the docs And it is working fine.
But the click events not working on the button.
Auth.js
User.jsx
If i only keep the following version of User.jsx it still doesn't work.
But as soon as i remove "readSession" import , the click event starts working.
The text was updated successfully, but these errors were encountered: