Skip to content

Is it possible to scroll to component after the component shown? #16

@ivanasetiawan

Description

@ivanasetiawan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions