Skip to content

Commit

Permalink
Fix code block formatting in references tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
dphfox committed Jul 3, 2024
1 parent 89d9fa5 commit 6f78500
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/tutorials/best-practices/references.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
At some point, you might need to refer to another part of the UI. There are
various techniques that can let you do this.

```Lua hl_lines="8"
```Lua hl_lines="5"
local ui = scope:New "Folder" {
[Children] = {
scope:New "SelectionBox" {
Expand Down Expand Up @@ -65,7 +65,7 @@ Because their `:set()` method returns the value that's passed in, you can use
```Lua
-- `selectionTarget` will show as `nil` to all code trying to use it, until the
-- `:set()` method is called later on.
local selectionTarget = scope:Value(nil :: Part?)
local selectionTarget: Fusion.Value<Part?> = scope:Value(nil)

local ui = scope:New "Folder" {
[Children] = {
Expand Down Expand Up @@ -94,8 +94,8 @@ because this lets you refer to parts of your UI that haven't yet been created.
In particular, this lets you create cyclic references.

```Lua
local aliceRef = scope:Value(nil :: Instance?)
local bobRef = scope:Value(nil :: Instance?)
local aliceRef: Fusion.Value<Instance?> = scope:Value(nil)
local bobRef: Fusion.Value<Instance?> = scope:Value(nil)

-- These two `ObjectValue` instances will refer to each other once the code has
-- finished running.
Expand Down

0 comments on commit 6f78500

Please sign in to comment.