weird behavior: a button declared in TSX with onClick does not have onClick in the final html?
o/ i have this
clicking on the button does nothing. inspecting the output html, i see this:
19 Replies
output html:
any idea?
this button was originally in a separate component, and this component was used multiple times. sometimes it worked, and many times it didn't.
The event is deferred from the container where the topmost parent is rendered.
not sure i understand
Just put a console.log into the event handler to check if it is working or if the hydration failed. Also, are there errors in the console?
nothing appears in console
no errors either
there's that:
it wouldn't appear because the event listener is supposed to be registered on the client-side through hydration
ahhh i see. what should i do though? make it a separate component then
'use client'
?no,
"use client"
isn't a thing
btw what setup of SSR is thisoh okay. it's just the one bootstrapped by
pnpm create solid
I see, does it mention SolidStart anywhere
nope (except in the README)
so it's a Start setup then. hmmm
weird that you don't have hydration here
the code above is in the app.tsx file
is there any other thing you have touched?
it was created with the "with-tailwindcss" in the CLI
i added the favicons to the entry-server.tsx file but that's it
is it possible for you to produce a repro of this?
yeah certainly
@lxsmnsyc 🤖 i wasn't able to reproduce it in the
basic
template. i noticed that its app.tsx
file has a <MetaProvider> tag wrapping the (props) => () thing (in my code it was just a <>)
when i added @solidjs/meta and wrapped it with MetaProvider everything worked
yeah all buttons click now
wrapping it with MetaProvider seemed to fix itmy project was using solid-start 0.5.2, which apparently does not report that. removing MetaProvider from the one with 0.5.4 reports an explicit error
the with-tailwindcss template may need updating haha