Open
Description
I apologize if this issue is known, or if it does not belong to this repo, but I could not find any answer anywhere, including ChatGPT.
Consider this dummy component:
import { Component, onMount } from "solid-js";
const Button: Component<void> = () => {
let myButton: HTMLButtonElement;
onMount(() => {
console.log({ myButton });
});
return <button ref={myButton!}>Text</button>;
};
export default Button;
When running this component, the button element will be printed on the console, however when running the following test the ref is undefined
import { describe, it } from "vitest";
import { render } from "@solidjs/testing-library";
import Button from "./button";
describe("Button Component", () => {
it("renders correctly", async () => {
render(() => <Button />);
});
});
Any ideas?
Metadata
Metadata
Assignees
Labels
No labels