Skip to content

Commit 1d04c6f

Browse files
author
Alex Lohr
committed
updates, documentation, tests
1 parent 70961af commit 1d04c6f

5 files changed

Lines changed: 974 additions & 488 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ const { result } = renderHook(createResult);
101101
expect(result).toBe(true);
102102
```
103103

104+
If you are using a `wrapper` with `renderHook`, make sure it will **always** return `props.children` - especially if you are using a context with asynchronous code together with `<Show>`, because this is required to get the value from the hook and it is only obtained synchronously once and you will otherwise only get `undefined` and wonder why this is the case.
105+
104106
⚠️ Solid.js supports [custom directives](https://www.solidjs.com/docs/latest/api#use___), which is a convenient pattern to tie custom behavior to elements, so we also have a `renderDirective` call, which augments `renderHook` to take a directive as first argument, accept an `initialValue` for the argument and a `targetElement` (string, HTMLElement or function returning a HTMLElement) in the `options` and also returns `arg` and `setArg` to read and manipulate the argument of the directive.
105107

106108
```ts

0 commit comments

Comments
 (0)