Should/How the Proxy
type for Reactive Objects be Identifiable in IntelliSense?
#11205
serkodev
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Due to the nature of Proxies, the types of
Proxy
objects and regular objects in TypeScript are identical.This creates a challenge when using reactive types (such as Props or Pinia stores). Specifically, when using
watch
, TypeScript's IntelliSense cannot determine whether a object is reactive or not.However, I am unsure of any methods to achieve this differentiation:
I have considered adding a special key-value pair to identify reactive objects, but this would alter the original object and might affect JSON stringification.
Related discussion:
microsoft/TypeScript#20846
Beta Was this translation helpful? Give feedback.
All reactions