Skip to content

Commit

Permalink
docs(attach): rewording (#870)
Browse files Browse the repository at this point in the history
* docs(attach): rewording

* chore: linter
  • Loading branch information
andretchen0 authored Nov 11, 2024
1 parent fbcbdc3 commit 486eecd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/advanced/attach.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `attach` prop is not required for many common cases. For instance:

## Background

Tres tries to automatically determine where to insert child tag into its parent. For example, in this code, Tres will:
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`
Expand Down Expand Up @@ -97,15 +97,15 @@ You can deeply attach a child to a parent by "piercing" – i.e., using a kebab-

First, here are a few simple pseudocode examples. This will attach `bar` at `foo.ab.cd`:

```html
```vue
<foo>
<bar attach="ab-cd" />
</foo>
```

This will attach `bar` at `foo.ab.cd.ef`:

```html
```vue
<foo>
<bar attach="ab-cd-ef" />
</foo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const positions = new Float32Array([
<h1><code>attach</code>: BufferGeometry</h1>
<h2>Setup</h2>
<p>
In this scene, there is a Mesh with a BufferGeometry, created with JSX. The BufferGeometry has a JSX BufferAttribute, attached to the BufferGeometry's <code>attributes.position</code> using <code>attach</code>.
In this scene, there is a Mesh, BufferGeometry, and a BufferAttribute. All are created in <code>&lt;template&gt;</code>. The BufferAttribute is attached to the BufferGeometry's <code>attributes.position</code> using the <code>attach</code> prop.
</p>
<h2>Preview</h2>
<img :src="previewDataUri" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const previewDataUri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CA
<h1><code>attach</code>: Post-processing</h1>
<h2>Setup</h2>
<p>
In this scene, there is a Box with a MeshNormalMaterial. The scene includes THREE post-processing passes added directly via JSX (using the <code>attach</code> prop), including "Unreal Bloom".
In this scene, there is a Box with a MeshNormalMaterial. The scene also includes a THREE EffectComposer and post-processing passes created in <code>&lt;template&gt;</code>.
</p>
<p>
The passes are inserted into <code>EffectComposer.passes</code> using the <code>attach</code> prop.
</p>
<h2>Preview</h2>
<img :src="previewDataUri" />
Expand Down

0 comments on commit 486eecd

Please sign in to comment.