local W=require(script.Parent.Parent.TableUtils.assign)local R=require(script.Parent.Parent.Option)local z=require(script.Parent.PropMarkers.Ref)local b=(require(script.Parent.GlobalConfig)).get()local w={[z]=R.None}local function I(R)if b.typeChecks then if type(R)~="\102\117\110\099\116\105\111\110"then error("\069\120\112\101\099\116\101\100 \097\114\103 \035\049 \116\111 \098\101 \097 \102\117\110\099\116\105\111\110",2)end end return function(b)local I=b[z]local l=W({},b,w)return R(l,I)end end return I
local assign = require(script.Parent.Parent.TableUtils.assign)
local Option = require(script.Parent.Parent.Option)

local Ref = require(script.Parent.PropMarkers.Ref)

local config = require(script.Parent.GlobalConfig).get()

local excludeRef = {
	[Ref] = Option.None,
}

--[[
	Allows forwarding of refs to underlying host components. Accepts a render
	callback which accepts props and a ref, and returns an element.
]]
local function forwardRef(render)
	if config.typeChecks then
		if type(render) ~= "function" then
			error("Expected arg #1 to be a function", 2)
		end
	end

	return function(props)
		local ref = props[Ref]
		local propsWithoutRef = assign({}, props, excludeRef)

		return render(propsWithoutRef, ref)
	end
end

return forwardRef
