react-sequence
React component which can aid navigation between a set of react components. The sequence of components will be set as the children(see usage). There are 3 available navigation options now and these will ne injected to the props of the components
- gotoNext - shall navigate to the next component
- gotoPrev - shall navigate to the previous component
- gotoKey - shall navigate to the component specified by the argument
Installation
npm install --save react-sequence
Usage
;;;;; ReactDOM;
Page2.jsx
; { return <div> <div>Page 2</div> <button onClick=propsgotoPrev>Prev</button> <button onClick= props>Next</button> </div> ;}
Page1.jsx
; { return <div> <div>Page 1</div> <button onClick=propsgotoPrev>Prev</button> <button onClick=propsgotoNext>Next</button> </div> ;}