React-jsonschema-form: Export typings from @rjsf/core

Created on 6 Feb 2020  路  4Comments  路  Source: rjsf-team/react-jsonschema-form

@epicfaace was wondering if there was plans for a new alpha release soon? Hasn't been one since Nov of last year.

Most helpful comment

@epicfaace I know the library is heading toward the direction of converting to typescript. With that in mind, the recent rename of the NPM module to @rjsf/core has caused some conflicts when trying to use this alpha.2 version with the @types/react-jsonschema-form typings.

There is a temp "solution", which kinda works, but not for my applicable purpose:

declare module '@rjsf/core' {
  import Form from 'react-jsonschema-form';

  export * from 'react-jsonschema-form';
  export * from 'react-jsonschema-form/lib/components/fields/SchemaField';
  export * from 'react-jsonschema-form/lib/utils';
  export * from 'react-jsonschema-form/lib/validate';

  export default Form;
}

I haven't tested the above fully, but may work for people using the out-of-the-box package.

I have to suggest, moving forward, that the next alpha version should include typings along with the package so that we don't have to rely on the @types package. Otherwise we would have to create and maintain another typings packing in the DefinitelyTyped repo, which seems cumbersome.

All 4 comments

Will do so soon, thanks for the reminder!

@epicfaace I know the library is heading toward the direction of converting to typescript. With that in mind, the recent rename of the NPM module to @rjsf/core has caused some conflicts when trying to use this alpha.2 version with the @types/react-jsonschema-form typings.

There is a temp "solution", which kinda works, but not for my applicable purpose:

declare module '@rjsf/core' {
  import Form from 'react-jsonschema-form';

  export * from 'react-jsonschema-form';
  export * from 'react-jsonschema-form/lib/components/fields/SchemaField';
  export * from 'react-jsonschema-form/lib/utils';
  export * from 'react-jsonschema-form/lib/validate';

  export default Form;
}

I haven't tested the above fully, but may work for people using the out-of-the-box package.

I have to suggest, moving forward, that the next alpha version should include typings along with the package so that we don't have to rely on the @types package. Otherwise we would have to create and maintain another typings packing in the DefinitelyTyped repo, which seems cumbersome.

Hope TypeScript Index of react-jsonschema-form to be merged

@chanceaclark good point, thanks. We could perhaps keep it in JS for now but just export the typings in the next version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhishekpdubey picture abhishekpdubey  路  3Comments

mammad2c picture mammad2c  路  3Comments

anttivikman picture anttivikman  路  3Comments

marinav picture marinav  路  3Comments

jabaren picture jabaren  路  3Comments