-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
The code sample:
local function MyComponent()
local selected, setSelected = React.useState(false)
return React.createElement(StudioComponents.Checkbox, {
Value = selected,
OnChanged = setSelected,
})
end... incorrectly assigns OnChanged to setSelected.
OnChanged is called with no values and should actually be used as follows:
local function MyComponent()
local selected, setSelected = React.useState(false)
return React.createElement(StudioComponents.Checkbox, {
Value = selected,
OnChanged = function()
setSelected(not selected)
end,
})
endMetadata
Metadata
Assignees
Labels
No labels