Skip to content

Instantly share code, notes, and snippets.

@keidrun
Last active September 8, 2019 07:35
Show Gist options
  • Save keidrun/bf6c3af105b8b0a6c3b830e35d8aae07 to your computer and use it in GitHub Desktop.
Save keidrun/bf6c3af105b8b0a6c3b830e35d8aae07 to your computer and use it in GitHub Desktop.
Demo codes for reactstrap-scrollspy
Scrollspy.defaultProps = {
homeIndex: 0,
topOffset: '50%',
bottomOffset: '40%',
delayMs: 50,
}
// @flow
import React from 'react'
import { Scrollspy } from 'reactstrap-scrollspy'
...
function App() {
return (
<>
<Scrollspy
names={['navbar', 'header', 'section-1', 'section-2', 'section-3', null]}
homeIndex={1}
>
<Navbar />
<Header />
<Section1 />
<Section2 />
<Section3 />
<Footer />
</Scrollspy>
</>
)
}
export default App
type Props = {
names: Array<string | null>,
homeIndex?: number,
topOffset?: string | number,
bottomOffset?: string | number,
delayMs?: number,
children: ChildrenArray<any>,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment