You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The appendChild(node: Node) for Node return type should be same as the child, not the parent. Now if you use the div element to add a span, it would cause error. I'm currently using a method below instead.
func addNode<T: Node>(_ node: T) -> T {
let result = self.jsValue.appendChild(node.jsValue)
return T.init(from: result)!
}
The text was updated successfully, but these errors were encountered:
bestwnh
changed the title
func appendChild(node: Node) return wrong type
Func appendChild(node: Node) return wrong type
Dec 6, 2023
bestwnh
changed the title
Func appendChild(node: Node) return wrong type
Function appendChild(node: Node) return wrong type
Dec 6, 2023
The
appendChild(node: Node)
forNode
return type should be same as the child, not the parent. Now if you use the div element to add a span, it would cause error. I'm currently using a method below instead.The text was updated successfully, but these errors were encountered: