Subscribe on changes!

inject/provide does not work with createVNode and render

avatar
Feb 11th 2021

Version

3.0.5

Reproduction link

https://codesandbox.io/s/gifted-goldwasser-ysz0d

Steps to reproduce

  1. use provide in the parent component
  2. Render component to child element with createVNode and render
  3. The rendered component won't have access to inject

What is expected?

Access to injected values from parent

What is actually happening?

Inject result is always undefined.

avatar
Feb 11th 2021

You shouldn't be using those functions manually. In general, if it doesn't appear in the documentation, you should avoid it

avatar
Feb 12th 2021

@posva How would you suggest rendering a component to an HTML element? (use case is for golden layout)