You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, withCtx does not accept type parameters and always returns a Function type. This causes type errors when used with slot functions that have specific typings in consuming components.
It would be helpful if withCtx accepted a generic type and returned the same function type:
When building a component library with JSX, we encountered a warning in production caused by not wrapping a slot function with withCtx:
[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.
It took significant time to trace this back to the missing withCtx wrapper. Adding documentation or usage notes—especially for JSX or render function contexts—would help developers avoid this issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request
1. Allow
withCtxto accept type parametersCurrently,
withCtxdoes not accept type parameters and always returns aFunctiontype. This causes type errors when used with slot functions that have specific typings in consuming components.It would be helpful if
withCtxaccepted a generic type and returned the same function type:2. Add documentation for
withCtxusageWhen building a component library with JSX, we encountered a warning in production caused by not wrapping a slot function with
withCtx:It took significant time to trace this back to the missing
withCtxwrapper. Adding documentation or usage notes—especially for JSX or render function contexts—would help developers avoid this issue.Beta Was this translation helpful? Give feedback.
All reactions