Click in order · Vue.js course · Module 7: Props & Events

Provide with Symbol syntax

Arrange the typed provide with InjectionKey:

Items to click

  • provide(key, ref('value'))
  • const val = inject(key)
  • const key: InjectionKey<Ref<string>> = Symbol()

You can check the correct answer by solving this task in the CodeWorlds game.