react-data-navigation
v1.0.0
Published
This package will help React developers to enhance their code by sending some data from one component to another component with out any hustle. Just follow the steps.
Downloads
4
Maintainers
Readme
Description
This package is for navigate the data in React JS, React Native. This package is for send data from one component to other in React JS. This package is mainly for beginner of React developement. This help you to navigate through components with some data.
Quick Start
All you need to do is one React project. Create some components where you want to navigate data in React.
Use of package
- Install react-data-navigation
npm i react-data-navigation --save
- You just need to import the DataNavigation class in your components.
- Import the DataNavigation class in your componet where you want to use this package Now you can use the package's methods.
home.js
import { DataNavigation } from 'react-data-navigation';
.
.
.
// For set the data you need to call setData(key, value) Function i.e.
// eg. DataNavigation.setData('name', 'Viren');
// it will set the 'Viren' as respect to 'name' key.
about.js
import { DataNavigation } from 'react-data-navigation';
.
.
.
// Here we want to get the name value, which you set in home component than
// console.log('Hey my name is' + DataNavigation.getData('name'));
// it will print in console : Hey my name is Viren.
Properties
- getData(key) : method It will return the value of data object
- getWholeData() : method It will give the whole data object
- removeData(key) : method It will delete the data in data object.
- setData(key, value) : method It will set the value in the object with key.
Author
Source code can be found on github
Developed by Virendra Yadav