local Q=require(script.Parent.assign)local R=require(script.Parent.None)local w=require(script.Parent.PropMarkers.Ref)local S=(require(script.Parent.GlobalConfig)).get()local u={[w]=R}local function l(R)if S.typeChecks then assert(typeof(R)=="\102\117\110\099\116\105\111\110","\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")end return function(S)local l=S[w]local h=Q({},S,u)return R(h,l)end end return l
local assign = require(script.Parent.assign)
local None = require(script.Parent.None)
local Ref = require(script.Parent.PropMarkers.Ref)

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

local excludeRef = {
	[Ref] = 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
		assert(typeof(render) == "function", "Expected arg #1 to be a function")
	end

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

		return render(propsWithoutRef, ref)
	end
end

return forwardRef
