Last active
September 8, 2019 07:35
-
-
Save keidrun/bf6c3af105b8b0a6c3b830e35d8aae07 to your computer and use it in GitHub Desktop.
Demo codes for reactstrap-scrollspy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scrollspy.defaultProps = { | |
homeIndex: 0, | |
topOffset: '50%', | |
bottomOffset: '40%', | |
delayMs: 50, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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