fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Property 'ref' does not exist on type 'IntrinsicAttributes & ITextFieldProps'

Open nguyentoantuit opened this issue 8 years ago • 4 comments

  • 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?

nguyentoantuit avatar Aug 23 '18 11:08 nguyentoantuit

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?

micahgodbolt avatar Aug 23 '18 14:08 micahgodbolt

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}
/>

nguyentoantuit avatar Aug 24 '18 02:08 nguyentoantuit

you shouldn't need ref and componentRef. ComponentRef replaced ref as a way to refer to the actual public interface of a control.

micahgodbolt avatar Dec 28 '18 00:12 micahgodbolt

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!

msft-github-bot avatar Jan 01 '19 01:01 msft-github-bot