You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classParentextendsReact.Component{privatechildRef: React.RefObject<Child>=React.createRef()bar(){if(this.childRef.current){/* * here typescript complains that * Property 'foo' does not exist on * type 'ConnectedComponentClass<typeof Child...' */this.childRef.current.foo();}}render(){return(<Childref={this.childRef}/>);}}
I've tried to set the generic type
<React.ComponentType<Child>>
explicitly when exporting child component, but still not working.
The text was updated successfully, but these errors were encountered:
piotrwitek
changed the title
Calling connected child instance method
How to safely access instance properties declared in a class component with createRef
Apr 12, 2019
I have a child component connected by redux
and a parent contains it
I've tried to set the generic type
explicitly when exporting child component, but still not working.
The text was updated successfully, but these errors were encountered: