Skip to content

Commit a0a5780

Browse files
committed
updated docs to reflect differences in render
1 parent 417adbe commit a0a5780

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,21 @@ If you using Jest we recommend using [solid-jest](https://github.com/solidjs/sol
5656

5757
See the [docs](https://testing-library.com/docs/preact-testing-library/intro) over at the Testing Library website.
5858

59-
There are two key difference, though:
59+
There are several key differences, though:
60+
61+
⚠️ The `render` function takes in a function that returns a Solid Component, rather than simply the component itself.
62+
63+
**Preact Testing Library**
64+
65+
```tsx
66+
const results = render(<YourComponent />, options);
67+
```
68+
69+
**Solid Testing Library**
70+
71+
```tsx
72+
const results = render(() => <YourComponent />, options);
73+
```
6074

6175
⚠️ Solid.js does *not* rerender, it merely executes side effects triggered by reactive state that change the DOM, therefore there is no rerender method. You can use global signals to manipulate your test component in a way that causes it to update.
6276

0 commit comments

Comments
 (0)