Skip to content

Commit 50116a3

Browse files
committed
Return component variable
Signed-off-by: Ryan Luu <ryan.luu@ryanluu.dev>
1 parent daed1f4 commit 50116a3

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

src/Components/Slot.luau

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ local function SlotButton(props: Props)
3636
}),
3737
ToolTip = React.createElement("TextLabel", {
3838
Text = props.tooltipText or "",
39-
[React.Tag] = "Tooltip",
39+
[React.Tag] = "ToolTip",
4040
}),
4141
StyleLink = React.createElement("StyleLink", {
4242
StyleSheet = game.ReplicatedStorage.Design.SatchelStyleSheet,

src/Stories/Backpack.story.luau

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ return {
99
react = React,
1010
reactRoblox = ReactRoblox,
1111
story = function()
12-
return React.createElement(Backpack)
12+
local component = React.createElement(Backpack, {})
13+
14+
return component
1315
end,
1416
}

src/Stories/Slot.story.luau

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,28 @@ local ReactRoblox = require("../../react-roblox")
66
local Slot = require("../Components/Slot")
77

88
local controls = {
9-
toolName = "Sword",
10-
slotNumber = "9",
11-
toolImage = "rbxasset://Textures/Sword128.png",
12-
tooltipText = "A classic sword",
13-
equipped = false,
14-
unlocked = false,
9+
ToolName = "Sword",
10+
SlotNumber = 9,
11+
ToolImage = "rbxasset://Textures/Sword128.png",
12+
TooltipText = "A classic sword",
13+
Equipped = false,
14+
Unlocked = false,
1515
}
1616

1717
return {
1818
react = React,
1919
reactRoblox = ReactRoblox,
2020
controls = controls,
2121
story = function(props)
22-
return React.createElement(Slot, {
23-
toolName = props.controls.toolName,
24-
slotNumber = props.controls.slotNumber,
25-
toolImage = props.controls.toolImage,
26-
tooltipText = props.controls.tooltipText,
27-
equipped = props.controls.equipped,
28-
unlocked = props.controls.unlocked,
22+
local component = React.createElement(Slot, {
23+
toolName = props.controls.ToolName,
24+
slotNumber = props.controls.SlotNumber,
25+
toolImage = props.controls.ToolImage,
26+
tooltipText = props.controls.TooltipText,
27+
equipped = props.controls.Equipped,
28+
unlocked = props.controls.Unlocked,
2929
})
30+
31+
return component
3032
end,
3133
}

0 commit comments

Comments
 (0)