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
{{ message }}
This repository was archived by the owner on Jun 4, 2026. It is now read-only.
importReactfrom"react";import{BrowserRouter}from"react-router-dom";//Can use HashRouter or MemoryRouter as wellimport{HashScroll}from"react-hash-scroll";constApp=()=>{return(<BrowserRouter><HashScrollhash="#hash1"position="center"><HashChild>Element #1</HashChild></HashScroll><HashScrollhash="#hash2"requiredPathname="/docs"><div>Element #2</div></HashScroll><HashScrollhash="#example"position="end">
Hello! (This does not work! Neither does <>Hello!</>) Children must be elements!
</HashScroll></BrowserRouter>);};constHashChild=React.forwardRef((props,ref))=>(// Must forward refs for custom HashScroll children<divref={ref}>{props.children}</div>)