# `attach` 🖇 Using the `attach` prop, you can tell Tres exactly where you want to insert a child into its parent. :::info The `attach` prop is not required for many common cases. For instance: * adding a single `` to a `` * adding a `` to a `` * adding one or more ``s to a parent `` ::: ## Background Tres tries to automatically determine where to insert a child tag into its parent. For example, in this code, Tres will: * automatically insert the geometry into `parent.geometry` * automatically insert the material into `parent.material` ```vue ``` ## Problem Tres covers common cases, like above. But it doesn't cover every possible case. When Tres doesn't automatically choose the proper insertion location for a child, one solution is to fall back to procedural code in ` ``` But this workaround means: * your materials aren't managed by Tres * your code is imperative, not declarative * your code is non-reactive by default ## Solution The `attach` prop lets you specify where an object will be added to the parent object using declarative code. ## Usage Here's the example above, rewritten declaratively using `attach`: ```vue ``` ## "Pierced" `attach` You can deeply attach a child to a parent by "piercing" – i.e., using a kebab-case string. ### Pseudocode First, here are a few simple pseudocode examples. This will attach `bar` at `foo.ab.cd`: ```vue ``` This will attach `bar` at `foo.ab.cd.ef`: ```vue ``` ### Usage As a concrete example, you can use "pierced" `attach` to add custom `BufferAttribute`s: ```vue ``` ## Arrays You can attach within arrays by using array indices in the `attach` string. ### Usage For example, you can use array indices to attach `THREE` post-processing passes to the `THREE.EffectComposer.passes` array: ```vue ```