-
Notifications
You must be signed in to change notification settings - Fork 332
Closed
Description
Hi there,
I found an issue with a React ref example. Inside a render()
method you suggest to
pass your ref with the reference to the targetElement
But if we do so, we don't assign actually this.targetRef
to the component and will always get a {current: null}
from react ref.
Changed this.targetElement
with this.targetRef
worked for me.
render() {
return (
// change this.targetElement with this.targetRef to actually access a react ref
{/*<SomeOtherComponent ref={this.targetElement}>*/}
<SomeOtherComponent ref={this.targetRef}>
some JSX to go here
</SomeOtherComponent>
);
}
Please update the README example.
Metadata
Metadata
Assignees
Labels
No labels