Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.addToQueue(renderedString + '', position);
}
}
// Push text directly to queue
} else if ((flags & VNodeFlags.Text) > 0) {
this.addToQueue(children === '' ? ' ' : escapeText(children), position);
// Handle errors
} else {
if (process.env.NODE_ENV !== 'production') {
if (typeof vNode === 'object') {
throwError(`renderToString() received an object that's not a valid VNode, you should stringify it first. Object: "${JSON.stringify(vNode)}".`);
} else {
throwError(`renderToString() expects a valid VNode, instead it received an object with the type "${typeof vNode}".`);
}
}
throwError();
}
}
}
}
if (flags & VNodeFlags.Element) {
return hydrateElement(vNode, parentDOM, currentDom, context, isSVG, lifecycle);
}
if (flags & VNodeFlags.Text) {
return hydrateText(vNode, parentDOM, currentDom);
}
if (flags & VNodeFlags.Void) {
return (vNode.dom = currentDom);
}
if (flags & VNodeFlags.Fragment) {
return hydrateFragment(vNode, parentDOM, currentDom, context, isSVG, lifecycle);
}
if (process.env.NODE_ENV !== 'production') {
throwError(`hydrate() expects a valid VNode, instead it received an object with the type "${typeof vNode}".`);
}
throwError();
return null;
}
return hydrateElement(vNode, parentDOM, currentDom, context, isSVG, lifecycle);
}
if (flags & VNodeFlags.Text) {
return hydrateText(vNode, parentDOM, currentDom);
}
if (flags & VNodeFlags.Void) {
return (vNode.dom = currentDom);
}
if (flags & VNodeFlags.Fragment) {
return hydrateFragment(vNode, parentDOM, currentDom, context, isSVG, lifecycle);
}
if (process.env.NODE_ENV !== 'production') {
throwError(`hydrate() expects a valid VNode, instead it received an object with the type "${typeof vNode}".`);
}
throwError();
return null;
}
if (childFlags === ChildFlags.HasVNodeChildren) {
return '';
} else if (childFlags & ChildFlags.MultipleChildren) {
let renderedString = '';
for (let i = 0, len = children.length; i < len; ++i) {
renderedString += renderVNodeToString(children[i], vNode, context);
}
return renderedString;
}
} else {
if (process.env.NODE_ENV !== 'production') {
if (typeof vNode === 'object') {
throwError(`renderToString() received an object that's not a valid VNode, you should stringify it first. Object: "${JSON.stringify(vNode)}".`);
} else {
throwError(`renderToString() expects a valid VNode, instead it received an object with the type "${typeof vNode}".`);
}
}
throwError();
}
return '';
}