react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

fix(@rjsf/core): Add formElement to Form TS definitions

Open rtalvarez opened this issue 3 years ago • 5 comments
trafficstars

Reasons for making this change

Adds the formElement definition to the Form TS interface

The Form object internally manages a reference called formElement, initially null that can be set via the ref property.

However, the TS definitions do not reflect this, therefore, consuming the library from a pure TS project will throw an error when attempting to access it.

I think this is the only change needed, but let me know if I'm missing anything

Checklist

  • [ ] I'm updating documentation
  • [x] I'm adding or updating code
    • [x] I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • [x] I've updated docs if needed
    • [x] I've updated the changelog with a description of the PR
  • [ ] I'm adding a new feature
    • [ ] I've updated the playground with an example use of the feature

rtalvarez avatar Aug 02 '22 17:08 rtalvarez

@rtalvarez So, in the upcoming v5 beta, Form has been converted to Typescript and it's types are properly being exported. Take a look at the code in the rjsf-v5 branch and let me know whether this seems appropriate for your needs...

heath-freenome avatar Aug 02 '22 19:08 heath-freenome

@rtalvarez So, in the upcoming v5 beta, Form has been converted to Typescript and it's types are properly being exported. Take a look at the code in the rjsf-v5 branch and let me know whether this seems appropriate for your needs...

Hey @heath-freenome , sorry for the late reply, I was out a couple of days. Unfortunate about that needing to be any, but other than that, yes that should address the issue. Do we know when v5 is expected to come out of beta?

rtalvarez avatar Aug 09 '22 16:08 rtalvarez

@rtalvarez So, in the upcoming v5 beta, Form has been converted to Typescript and it's types are properly being exported. Take a look at the code in the rjsf-v5 branch and let me know whether this seems appropriate for your needs...

Hey @heath-freenome , sorry for the late reply, I was out a couple of days. Unfortunate about that needing to be any, but other than that, yes that should address the issue. Do we know when v5 is expected to come out of beta?

Hoping to have it out before the end of August...

heath-freenome avatar Aug 12 '22 00:08 heath-freenome

@rtalvarez Can you verify that the v5 beta has the proper typing that you need?

heath-freenome avatar Sep 07 '22 16:09 heath-freenome

@rtalvarez Can you verify that the v5 beta has the proper typing that you need?

Sure, I'll try it and get back to you

rtalvarez avatar Sep 08 '22 14:09 rtalvarez

Since this file no longer exists I am closing the PR...

heath-freenome avatar Dec 03 '22 04:12 heath-freenome