https://github.com/arunghosh/react-sequence
React component which can aid navigation between set of react components
https://github.com/arunghosh/react-sequence
navigation next previos react sequence
Last synced: 6 months ago
JSON representation
React component which can aid navigation between set of react components
- Host: GitHub
- URL: https://github.com/arunghosh/react-sequence
- Owner: arunghosh
- License: mit
- Created: 2017-03-08T16:58:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-11-04T23:14:27.000Z (over 5 years ago)
- Last Synced: 2025-03-24T23:33:41.287Z (about 1 year ago)
- Topics: navigation, next, previos, react, sequence
- Language: JavaScript
- Homepage:
- Size: 6.78 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
[](https://travis-ci.org/arunghosh/react-sequence)
## Installation
```
npm install --save react-sequence
```
## Usage
```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import SeqenceForm from 'react-sequence';
import Page1 from './Page1';
import Page2 from './Page2';
ReactDOM.render(
,
document.getElementById('app')
);
```
**Page2.jsx**
```javascript
import React from 'react';
function Page2(props) {
return (
Page 2
Prev
props.gotoKey('page1')}>Next
);
}
export default Page2
```
**Page1.jsx**
```javascript
import React from 'react';
function Page1(props) {
return (
Page 1
Prev
Next
);
}
export default Page1
```