Passing Data Using React-Native Navigation

后端 未结 7 2056
野性不改
野性不改 2020-12-16 13:30

Im trying to pass data between screens in my app. Currently I am using


\"react-native\": \"0.46.0\",
\"react-navigation\": \"^1.0.0-beta.11\"
<         


        
相关标签:
7条回答
  • 2020-12-16 14:30

    I have developed an NPM package for send data from one component to other components. Please do check and use its easy to use.

    React data navigation

    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.
    
    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.
    

    Comment down for any help.

    0 讨论(0)
提交回复
热议问题