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,
}
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