Commit da95afc6 authored by Kati Paizee's avatar Kati Paizee

Merge branch 'docs-a_akgun-master-patch-02506' into 'master'

Docs on warning that provide/inject breaking child components

See merge request gitlab-org/gitlab!85096
parents 0c57267a 10bbd2e7
...@@ -123,6 +123,10 @@ Using dependency injection to provide values from HAML is ideal when: ...@@ -123,6 +123,10 @@ Using dependency injection to provide values from HAML is ideal when:
prop-drilling becomes an inconvenience. Prop-drilling when the same prop is passed prop-drilling becomes an inconvenience. Prop-drilling when the same prop is passed
through all components in the hierarchy until the component that is genuinely using it. through all components in the hierarchy until the component that is genuinely using it.
Dependency injection can potentially break a child component (either an immediate child or multiple levels deep) if the value declared in the `inject` configuration doesn't have defaults defined and the parent component has not provided the value using the `provide` configuration.
- A [default value](https://vuejs.org/guide/components/provide-inject.html#injection-default-values) might be useful in contexts where it makes sense.
##### props ##### props
If the value from HAML doesn't fit the criteria of dependency injection, use `props`. If the value from HAML doesn't fit the criteria of dependency injection, use `props`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment