How to add a tag ID into Widget properties

0
I am creating a Select/Drop-Down pluggable widget, using select tag, I tried to add id properties into *.d.ts, but when I execute ‘npm run dev’, the id property was removed?  Do I need special setup on .xml file to create ID property?  the ID is a html element id, I think it should be auto generated. I learned sample code from Github, but I didn’t get any hint,  if you can help on it, thanks in advance. 
asked
1 answers
0

Dear Lui,

This is an known issue https://github.com/mendix/pluggable-widgets-typing-generator/issues/36 I hope it will be fixed soon.

The type generator is generating the d.ts file based on xml file. So you can not change the files as it will be overwritten.

Suggestion to import the type and to extend it before using it.

import { MyWidgetContainerProps } from "../typings/MyWidgetProps";


interface MyWidgetpContainerPropsFixed extends MyWidgetContainerProps {
    id: string;
}

const MyWidget: FunctionComponent<MyWidgetContainerPropsFixed> = props => {
    return <div>MyWidget</div>;
}

Cheers, Andries

 

answered