Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

React scroll #189

Open
ini10000 opened this issue Jul 13, 2019 · 1 comment
Open

React scroll #189

ini10000 opened this issue Jul 13, 2019 · 1 comment

Comments

@ini10000
Copy link

Please I need help in combining these two packages react-sidebar and react-scroll. How can I use react-sidebar to hold the links with scroll-spy on and the rest of the page content to scroll on click with react-scroll. I tried modifying the responsive-example from the repo. This is my code..
Screenshot at 2019-07-13 19-25-46

@ini10000
Copy link
Author

The code...
`

const contentHeader = (
  <span>
    {!this.state.docked && (
      <a
        onClick={this.toggleOpen}
        href="#"
        style={styles.contentHeaderMenuLink}
      >
        =
      </a>
    )}
    <span> Responsive React Sidebar</span>
    
  </span>
);

const sidebarProps = {
  sidebar,
  docked: this.state.docked,
  open: this.state.open,
  onSetOpen: this.onSetOpen,
  contentId: 'Element'
};

return (
  <div>
    <Element>
      <Sidebar  {...sidebarProps}>
        <MaterialTitlePanel title={contentHeader}>
          <div style={styles.content}> 
            <Element>
              <Element name="test1" id="test1" className="fake-height">
                <div className="">test 1 </div>
              </Element>
              <Element name="test2" id="test2" className="fake-height">
                <div className="">test 2 </div>
              </Element>
              <Element name="test3" id="test3"  className="fake-height">
                <div className="">test 3 </div>
              </Element>
            </Element>
          </div>
        </MaterialTitlePanel>
      </Sidebar>
    </Element>
  </div>
);

}
`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant