Skip to content

docs: 📝 Added tip to add explicit types #3106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/api/render-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ Creates virtual DOM nodes (vnodes).
})
```

::: tip

While using Render Functions with [generic components](api/sfc-script-setup.html#generics) ,make sure to specify the types explicitly

```js

const FunctionalComponent = () => h(Comp<string>, {
modelValue: foo.value,
['onUpdate:modelValue']: (val) => foo.value = val,
});


```

:::

- **See also** [Guide - Render Functions - Creating VNodes](/guide/extras/render-function#creating-vnodes)

## mergeProps() {#mergeprops}
Expand All @@ -101,9 +117,9 @@ Merge multiple props objects with special handling for certain props.

- **Type**

```ts
function mergeProps(...args: object[]): object
```
```ts
function mergeProps(...args: object[]): object
```

- **Details**

Expand Down Expand Up @@ -305,7 +321,10 @@ For adding built-in [`v-on` modifiers](/guide/essentials/event-handling#event-mo
- **Type**

```ts
function withModifiers(fn: Function, modifiers: ModifierGuardsKeys[]): Function
function withModifiers(
fn: Function,
modifiers: ModifierGuardsKeys[]
): Function
```

- **Example**
Expand Down