local function f(f,V,X)if config.typeChecks then assert(f~=nil,"\096\099\111\109\112\111\110\101\110\116\096 \105\115 \114\101\113\117\105\114\101\100")assert(typeof(V)=="\116\097\098\108\101"or V==nil,"\096\112\114\111\112\115\096 \109\117\115\116 \098\101 \097 \116\097\098\108\101 \111\114 \110\105\108")assert(typeof(X)=="\116\097\098\108\101"or X==nil,"\096\099\104\105\108\100\114\101\110\096 \109\117\115\116 \098\101 \097 \116\097\098\108\101 \111\114 \110\105\108")end if V==nil then V={}end if X~=nil then if V[Children]~=nil then Logging.warnOnce(multipleChildrenMessage)end V[Children]=X end local n=ElementKind.fromComponent(f)local K={[Type]=Type.Element;[ElementKind]=n,component=f,props=V}if config.elementTracing then K.source=(debug.traceback("",2)):sub(2)end return K end return f
--[[
	Creates a new element representing the given component.

	Elements are lightweight representations of what a component instance should
	look like.

	Children is a shorthand for specifying `Roact.Children` as a key inside
	props. If specified, the passed `props` table is mutated!
]]
local function createElement(component, props, children)
	if config.typeChecks then
		assert(component ~= nil, "`component` is required")
		assert(typeof(props) == "table" or props == nil, "`props` must be a table or nil")
		assert(typeof(children) == "table" or children == nil, "`children` must be a table or nil")
	end

	if props == nil then
		props = {}
	end

	if children ~= nil then
		if props[Children] ~= nil then
			Logging.warnOnce(multipleChildrenMessage)
		end

		props[Children] = children
	end

	local elementKind = ElementKind.fromComponent(component)

	local element = {
		[Type] = Type.Element,
		[ElementKind] = elementKind,
		component = component,
		props = props,
	}

	if config.elementTracing then
		-- We trim out the leading newline since there's no way to specify the
		-- trace level without also specifying a message.
		element.source = debug.traceback("", 2):sub(2)
	end

	return element
end

return createElement
