---
source: https://iinventedlight.com/library/notes/vue-provide-inject.md
title: "Vue provide and inject skip prop drilling across deep trees"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0, text only (vuejs/docs); MIT (vuejs/core); prose restates cited source lines in own words"
license_family: vue-docs-ccby
attribution: "Summary by iinventedlight (AI-assisted). Sources: Vue.js docs, Provide / Inject, CC BY 4.0, text only (vuejs/docs); Vue.js core, runtime-core apiInject, MIT (vuejs/core). Notices: Vue.js documentation (vuejs/docs): Copyright (c) 2019-present, Yuxi (Evan) You and Vue documentation contributors; CC BY 4.0, text only (https://raw.githubusercontent.com/vuejs/docs/main/LICENSE). Vue.js core (vuejs/core): Copyright (c) 2018-present, Yuxi (Evan) You and Vue contributors; MIT (https://raw.githubusercontent.com/vuejs/core/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-10
status: published
approved_by: "Cole Withington, 2026-11-10 10:08 PT, Librarian chat widget t33s2: \"Yes, publish all 25 Django and Vue drafts\""
checked_on: 2026-11-10
as_of: 2026-11-10
confidence: medium
untested: "No Vue app was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-web: Vue provide inject"
tags: [vue, provide, inject, components]
client: Librarian
sources:
  - id: S1
    title: "Provide / Inject"
    publisher: Vue.js docs
    url: https://vuejs.org/guide/components/provide-inject.html
    accessed: 2026-11-10
    license: "CC BY 4.0"
  - id: S2
    title: "runtime-core apiInject"
    publisher: Vue.js core source
    url: https://github.com/vuejs/core/blob/main/packages/runtime-core/src/apiInject.ts
    accessed: 2026-11-10
    license: "MIT"
---
# Vue provide and inject skip prop drilling across deep trees

**Answer:** Props pass data from parent to child, but a deep tree would have to thread the same prop through every ancestor. `provide` and `inject` skip that props drilling.

## The pattern

A parent can be a dependency provider for all of its descendants. Any descendant, however deep, can inject dependencies provided up the parent chain.

## Runtime rules

`provide()` can only be used inside `setup()`. By default an instance inherits its parent's provides object. When the instance provides its own values, it makes a new provides object whose prototype is the parent provides object. `inject()` can only be used inside `setup()` or functional components.

## See also

- [vue-props](https://iinventedlight.com/library/notes/vue-props/)
- [vue-composables](https://iinventedlight.com/library/notes/vue-composables/)

## Claims

- id: C1
  claim: provide and inject are the way to avoid props drilling.
  source: S1
  evidence: "We can solve props drilling with `provide` and `inject`."

- id: C2
  claim: A parent can provide dependencies for all of its descendants.
  source: S1
  evidence: "A parent component can serve as a **dependency provider** for all its descendants."

- id: C3
  claim: provide() can only be used inside setup().
  source: S2
  evidence: "provide() can only be used inside setup()."

- id: C4
  claim: inject() can only be used inside setup() or functional components.
  source: S2
  evidence: "inject() can only be used inside setup() or functional components."

## Sources

- [S1] Provide / Inject. Vue.js docs. https://vuejs.org/guide/components/provide-inject.html . License: CC BY 4.0. Accessed 2026-11-10.

- [S2] runtime-core apiInject. Vue.js core source. https://github.com/vuejs/core/blob/main/packages/runtime-core/src/apiInject.ts . License: MIT. Accessed 2026-11-10.


License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Vue.js documentation (vuejs/docs): Copyright (c) 2019-present, Yuxi (Evan) You and Vue documentation contributors; CC BY 4.0, text only (https://raw.githubusercontent.com/vuejs/docs/main/LICENSE). Vue.js core (vuejs/core): Copyright (c) 2018-present, Yuxi (Evan) You and Vue contributors; MIT (https://raw.githubusercontent.com/vuejs/core/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
