Property 'ref' does not exist on type 'IntrinsicAttributes & ITextFieldProps'
- Package version(s): 6.53.0
Describe the issue:
Today, I upgrade to latest version 6.53.0 and run into problem Property 'ref' does not exist on type 'IntrinsicAttributes & ITextFieldProps'
I know that we have componentRef but I can't use this property to implement validation in general way. I have implement a validation component which is loop on this.refs to find ref by name for example "MandatoryValidationOnSubmit_0", "MandatoryValidationOnSubmit_1", "MandatoryValidationOnSubmit_2" ... then check mandatory. So that why I really need the prop ref here.
Does anyone have a workaround solution to make ref property visible again?
Can you give us a specific code example or provide us with the component you are trying to use? At what version did this use to work?
Hi @micahgodbolt I am using version 6.53.0. It just worked fine with version 6.37.0. Here is my code:
<TextField
ref={Utilities.generateUniqueId(Constants.MandatoryValidationOnSubmit)}
componentRef={ref => this._description = ref}
autoComplete="off"
onGetErrorMessage={this._validateMandatoryField}
validateOnLoad={false}
errorMessage=""
onBeforeChange={value => this.setState(assign({}, this.state, { descriptionError: '' }))}
onChanged={this._dirtyForm}
/>
you shouldn't need ref and componentRef. ComponentRef replaced ref as a way to refer to the actual public interface of a control.
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!