Skip to content

Commit 788214f

Browse files
authored
feat: fix incorrect function name in render delegation docs (#189)
1 parent 120588a commit 788214f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/delegation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ Let's create a custom `<Button />` component that could be used with this patter
5555

5656
```svelte
5757
<script lang="ts">
58-
import { builderActions, builderAttrs, type Builder } from "bits-ui";
58+
import { builderActions, getAttrs, type Builder } from "bits-ui";
5959
export let builders: Builder[] = [];
6060
</script>
6161
62-
<button use:builderActions={{ builders }} {...builderAttrs(builders)}>
62+
<button use:builderActions={{ builders }} {...getAttrs(builders)}>
6363
<slot />
6464
</button>
6565
```
6666

67-
We're using the `builderActions` and `builderAttrs` helpers to apply the actions and attributes to the button. We're also using the `Builder` type to type the `builders` prop we'd receive from whatever component we're using this with. We use an array here to cover the case where we may want to apply multiple builders to the button. The helper functions handle applying all the actions and attributes to the button for us.
67+
We're using the `builderActions` and `getAttrs` helpers to apply the actions and attributes to the button. We're also using the `Builder` type to type the `builders` prop we'd receive from whatever component we're using this with. We use an array here to cover the case where we may want to apply multiple builders to the button. The helper functions handle applying all the actions and attributes to the button for us.
6868

6969
If you do plan to pass multiple builders, the order in which you pass them matters. Certain actions/attributes may override others, so be sure to test your implementation to ensure it's working as expected.

0 commit comments

Comments
 (0)