Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ local function attachBinding(hostInstance, key, newBinding): ()
instanceToBindings[hostInstance] = {}
end

instanceToBindings[hostInstance][key] =
React.__subscribeToBinding(newBinding, updateBoundProperty)

instanceToBindings[hostInstance][key] = newBinding:_subscribe(updateBoundProperty)
updateBoundProperty(newBinding:getValue())
end

Expand Down
15 changes: 8 additions & 7 deletions modules/react/src/React.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,19 @@ return {
-- ROBLOX TODO: REACT_SCOPE_TYPE as unstable_Scope,
-- ROBLOX TODO: useOpaqueIdentifier as unstable_useOpaqueIdentifier,

-- ROBLOX deviation START: bindings support
-- ROBLOX DEVIATION START: bindings support
__subscribeToBinding = @[deprecated{ use = "ReactBinding:_subscribe()" }] function<T>(
binding: ReactBinding<T>,
f: (value: T) -> ()
): () -> ()
return binding:_subscribe()
end,
createBinding = ReactBinding.create,
joinBindings = ReactBinding.join,
-- ROBLOX deviation END
-- ROBLOX DEVIATION END

-- ROBLOX DEVIATION: export the `None` placeholder for use with setState
None = ReactNone,

-- ROBLOX FIXME: These aren't supposed to be exposed, but they're needed by
-- the renderer in order to update properly
__subscribeToBinding = ReactBinding.subscribe,

-- ROBLOX DEVIATION: export Change, Event, and Tag from React
Event = require(Packages.Shared).Event,
Change = require(Packages.Shared).Change,
Expand Down
Loading