JonathanExcelsior
JonathanExcelsior
SSolidJS
Created by JonathanExcelsior on 2/24/2025 in #support
How does Solid attach event handlers to DOM elements?
I see. It seems I have to think about testing differently then. I'm currently testing the component in isolation and wanted to test that the component doesn't have the event handler under certain conditions and does otherwise (based on props). Testing what I expect to happen would be more of an integration test with other components. I did ask in the testing channel if there is a comprehensive guide to testing a SolidJS application as I'm not sure how to effectively test following the philosophy I mentioned in my last message. I am still curious how Solid attaches event handlers to DOM elements though. Thanks for your help!
8 replies
SSolidJS
Created by JonathanExcelsior on 2/24/2025 in #support
How does Solid attach event handlers to DOM elements?
@zulu Great question. I used the method you mentioned prior. I tested if the event handler was called. However, I'm trying to follow the "test your application how it should be used, not implementation details" philosophy. Which means testing DOM elements more or less. Testing if the event handler was called is an implementation detail. Unless I'm thinking about this incorrectly 🤷🏾‍♂️
8 replies
SSolidJS
Created by JonathanExcelsior on 1/12/2025 in #support
createSignal vs createStore
@Alex Lohr This is insightful!
6 replies
SSolidJS
Created by JonathanExcelsior on 7/13/2023 in #support
Can you use the reactive object from useSearchParams as a source signal for createResource?
@._rb Thanks
5 replies
SSolidJS
Created by JonathanExcelsior on 7/13/2023 in #support
Can you use the reactive object from useSearchParams as a source signal for createResource?
@thetarnav I meant a property from the reactive object. E.g. const [resource] = createResource(searchParams.property, fetcher)
5 replies
SSolidJS
Created by JonathanExcelsior on 12/23/2022 in #support
Rendering issue
FYI, I did find a workaround but is not elegant. I'll keep trying!
10 replies
SSolidJS
Created by JonathanExcelsior on 12/23/2022 in #support
Rendering issue
Yes, this is what I was experiencing. Thanks for that! solid
10 replies
SSolidJS
Created by JonathanExcelsior on 12/23/2022 in #support
Rendering issue
Or I was thinking making an copy of the piece of state as it's an array of JSX elements generated using <For> element.
10 replies
SSolidJS
Created by JonathanExcelsior on 12/23/2022 in #support
Rendering issue
I meant one out of the two JSX elements. Yes, I am trying to do that. I will give that a go. Thanks!
10 replies
SSolidJS
Created by JonathanExcelsior on 12/3/2022 in #support
Props
Ok thanks! That was a solid answer! solid
4 replies