react-jsonschema-form
react-jsonschema-form copied to clipboard
Migrate core widget folder to typescript
Reasons for making this change
Migrated widgets folder to Typescript.
Since I'm quite new in Typescript land, please look thoroughly at my changes and don't hesitate writing picky comments as I would like to learn how to do this properly. :)
Checklist
- [ ] I'm updating documentation
- [ ] I've checked the rendering of the Markdown text I've added
- [x] I'm adding or updating code
- [ ] I'm adding a new feature
- [ ] I've updated the playground with an example use of the feature
@jimmycallin FYI, I'm doing the conversion of Fields today so no need to do them if you were considering it
@heath-freenome I think/hope I addressed all your comments now!
So changing
anytoWidgetProps<T, F>broke things?
(Weirdly enough I couldn't respond directly to that comment)
Yes, exactly. Getting the following error:
semantic error TS2769: No overload matches this call.
Overload 1 of 2, '(props: WidgetProps<T, F>, context?: any): ReactElement<any, any> | Component<WidgetProps<T, F>, any, any> | null', gave the following error.
Type '{ schema: { type: "integer"; }; id: string; className: string; options: { enumOptions: { value: number; label: string; }[]; }; placeholder: any; value: any; disabled: boolean | undefined; readonly: boolean | undefined; autofocus: boolean | undefined; onChange: (value: any) => any; onBlur: (id: string, value: any) =>...' is missing the following properties from type 'WidgetProps<T, F>': onFocus, label, registry
Ready for review again!
So changing
anytoWidgetProps<T, F>broke things?(Weirdly enough I couldn't respond directly to that comment)
Yes, exactly. Getting the following error:
semantic error TS2769: No overload matches this call. Overload 1 of 2, '(props: WidgetProps<T, F>, context?: any): ReactElement<any, any> | Component<WidgetProps<T, F>, any, any> | null', gave the following error. Type '{ schema: { type: "integer"; }; id: string; className: string; options: { enumOptions: { value: number; label: string; }[]; }; placeholder: any; value: any; disabled: boolean | undefined; readonly: boolean | undefined; autofocus: boolean | undefined; onChange: (value: any) => any; onBlur: (id: string, value: any) =>...' is missing the following properties from type 'WidgetProps<T, F>': onFocus, label, registry
I'll look at it once it merges and see if I can figure out what the problem is