local counter = hookify(function()
local count, setCount = hookify.useState(0)
return Roact.createElement("TextButton", {
Text = ("Current count is %d"):format(count),
TextSize = 24,
Position = UDim2.new(0.5, 0, 0.5, 0),
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = Color3.new(1, 1, 1),
[Roact.Event.Activated] = function()
setCount(count + 1)
end
})
end)
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Use and implement hooks in Roact
License
Reselim/roact-hookify
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Use and implement hooks in Roact