Skip to content

customRef文档显示类型有误 #3400

Open

Description

@shengxiangx
Image track的返回值显示为void,实际为Link | undefined

Activity

  1. smituparmar01 commented on Oct 21, 2026

    @smituparmar01

    Hi! I'd like to take this one.

    Before I open a PR, could you confirm the intended fix? My understanding is that the docs show track returning void while the actual return type is Link | undefined. Should the docs show that type as-is, or would you prefer a different wording since Link may be an internal type?

    I'll check the current source and the page in the repo, and open a small PR once you confirm.

  2. AloisSeckar commented on Oct 21, 2026

    @AloisSeckar
    Contributor

    The current type definition of CustomRefFactory in latest Vue 3.5.44 is:

    type CustomRefFactory<T, S = T> = (
      track: () => void,
      trigger: () => void,
    ) => {
      get: () => T
      set: (value: S) => void
    }
    

    https://github.com/vuejs/core/blob/v3.5.44/packages/reactivity/src/ref.ts#L285

    So the docs are a bit off, but in a different way than suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions