We face below error while using ref in our ReactJS application.
Error: Property ‘myRef’ does not exist on type ‘MyComponent
To resolve this error, declare your ref variable inside the class component
export default class MyComponent extends React.Component<IMyComponentProps, any> { private myRef; constructor(props) { super(props); this.myRef = React.createRef(); } }