@builder.io/mitosis 0.5.25 → 0.5.26

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.
@@ -890,9 +890,10 @@ const componentToAngular = (userOptions = {}) => ({ component: _component }) =>
890
890
  ${Array.from(props)
891
891
  .filter((item) => !(0, slots_1.isSlotProperty)(item) && item !== 'children')
892
892
  .map((item) => {
893
+ const hasDefaultProp = json.defaultProps && json.defaultProps.hasOwnProperty(item);
893
894
  const propType = propsTypeRef ? `${propsTypeRef}["${item}"]` : 'any';
894
- let propDeclaration = `@Input() ${item}${options.typescript ? `!: ${propType}` : ''}`;
895
- if (json.defaultProps && json.defaultProps.hasOwnProperty(item)) {
895
+ let propDeclaration = `@Input() ${item}${options.typescript ? `${hasDefaultProp ? '' : '!'}: ${propType}` : ''}`;
896
+ if (hasDefaultProp) {
896
897
  propDeclaration += ` = defaultProps["${item}"]`;
897
898
  }
898
899
  return propDeclaration;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "name": "Builder.io",
23
23
  "url": "https://www.builder.io"
24
24
  },
25
- "version": "0.5.25",
25
+ "version": "0.5.26",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {