@tscircuit/core 0.0.304 → 0.0.305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -929,6 +929,11 @@ var PrimitiveComponent = class extends Renderable {
|
|
|
929
929
|
this.parent?.onChildChanged?.(child);
|
|
930
930
|
}
|
|
931
931
|
add(component) {
|
|
932
|
+
if (!component.onAddToParent) {
|
|
933
|
+
throw new Error(
|
|
934
|
+
`Invalid JSX Element: Expected a React component but received "${JSON.stringify(component)}"`
|
|
935
|
+
);
|
|
936
|
+
}
|
|
932
937
|
component.onAddToParent(this);
|
|
933
938
|
component.parent = this;
|
|
934
939
|
this.children.push(component);
|