systemProperty key=Label breaks my hello world custom widget

0
Hi. I’m following https://docs.mendix.com/howto/extensibility/create-a-pluggable-widget-one and as soon as I add <systemProperty key="Label" /> to the widget xml the properties “class” and “style” disappear from the generated interface “TextBoxContainerProps” and in the output of `npm start` I see the following: (typescript plugin) src\TextBox.tsx (14:27) Error: @rollup/plugin-typescript TS2339: Property 'style' does not exist on type 'Readonly<TextBoxContainerProps> & Readonly<{ children?: ReactNode; }>'. 14 style={this.props.style} ~~~~~ Why is this happening?
asked
2 answers
0

Hi – 

I came across the same issue and the solution appears to be some changes to the instructions in the pluggable widget documentation. Specifically:

In TextBox.tsx, delete the lines below. This is because style and class aren’t defined as Text Inputs.

 style={this.props.style}
 className={this.props.class}
answered
0

After adding systemProperty key="Label" all usages of `{this.props.style}` and `{this.props.class}` should be removed because labeled widgets do not have them and the styling is applied to the surrounding FormGroup.

answered