Skip to content

Commit 4129f99

Browse files
authored
Merge pull request #26 from pting-me/render-doc-update
updated docs to reflect differences in render
2 parents 417adbe + eae13ff commit 4129f99

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ 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+
```tsx
64+
// With @testing-library/preact
65+
const results = render(<YourComponent />, options);
66+
```
67+
68+
```tsx
69+
// With solid-testing-library
70+
const results = render(() => <YourComponent />, options);
71+
```
6072

6173
⚠️ 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.
6274

0 commit comments

Comments
 (0)