I need to scroll to the component after it gets rendered to the page. The component itself is not shown bu default (the component will be rendered when example_shown is true). Something like this:
{props.example_shown && ( <ExtraComponent /> )}
and inside the ExtraComponent, I give ref={(section) => { this.ExtraComponent = section }}.
I tried to call scrollToComponent inside componentDidMount() but this.ExtraComponent returns to null. How can I scroll to position
I need to scroll to the component after it gets rendered to the page. The component itself is not shown bu default (the component will be rendered when
example_shownistrue). Something like this:{props.example_shown && ( <ExtraComponent /> )}and inside the
ExtraComponent, I giveref={(section) => { this.ExtraComponent = section }}.I tried to call
scrollToComponentinsidecomponentDidMount()butthis.ExtraComponentreturns tonull. How can I scroll to position