Skip to content
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

[Runtime]: cannot access props, attrs, emits from render function #84

Closed
ubugeeei opened this issue Jan 3, 2024 · 3 comments
Closed
Assignees
Labels
on discussing question Further information is requested runtime

Comments

@ubugeeei
Copy link
Member

ubugeeei commented Jan 3, 2024

related: #47 (comment)

I implemented Component's Proxy in the PR that implements props, but found that it was erased in this commit.

Without it, I don't know how to access props from the render function, since the ctx I receive as argument to the render function does not include props.

this issue blocks #81, #42, #47, #54


I am assuming the following code, or am I wrong? 🤔

const Comp = defineComponent({
  props: ['foo'],
  setup() {
    const __returned__ = {}
    Object.defineProperty(__returned__, '__isScriptSetup', {
      enumerable: false,
      value: true,
    })
    return __returned__
  },
  render(_ctx: any) {
    const t0 = template('<div></div>')
    const n0 = t0()
    const {
      0: [n1],
    } = children(n0)
    watchEffect(() => {
      setText(n1, void 0, _ctx.foo) // here!
    })
    return n0
  },
})
@ubugeeei ubugeeei added question Further information is requested on discussing labels Jan 3, 2024
@ubugeeei
Copy link
Member Author

ubugeeei commented Jan 3, 2024

@sxzz
I need a response when you have time. 🙏🏻

@sxzz
Copy link
Member

sxzz commented Jan 12, 2024

Let's discuss about public instance here #74 (comment)

@ubugeeei
Copy link
Member Author

!!
Ok! Thanks!

@ubugeeei ubugeeei mentioned this issue Mar 25, 2024
7 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
on discussing question Further information is requested runtime
Projects
None yet
Development

No branches or pull requests

2 participants