Get state from multi screen to one screen?How to get the browser to navigate to URL in JavaScriptResetting the navigation stack for the home screen (React Navigation and React Native)react native navigator:Undefined is not an object(evaluating this.props.navigation.navigate)React Native navigation - undefined is not an objectReact Navigation: 'navigation.state.params' is always undefined in 'static navigationOptions'Navigate to another screen from Flat list item getting pressedNot able to navigate to other page in react nativeModalFilterPicker load more on scrollnavigate from another screen on click navigationDrawerLayout menuUnable to pass params successfully to another .js file/screen

Would an object shot from earth fall into the sun?

Population of post-Soviet states. Why decreasing?

Convert a string of digits from words to an integer

Whaling ship logistics

what organs or modifications would be needed to have hairy fish?

What in my code changed between MacTeX 2017 and MacTex 2019?

I transpose the source code, you transpose the input!

Installation of ImageMagick software fails with "configure: error: libltdl is required"

What are examples of EU policies that are beneficial for one EU country, disadvantagious for another?

String whitespaces

Another student has been assigned the same MSc thesis as mine (and already defended)

How to prevent pickpocketing in busy bars?

Are fuzzy sets appreciated by OR community?

Assembly of PCBs containing a mix of SMT and thru-hole parts?

Why is a road bike faster than a city bike with the same effort? How much faster it can be?

Is population size a parameter, or sample size a statistic?

Top off gas with old oil, is that bad?

Does variance make sense in a fully immutable language?

Why does Captain Marvel in the MCU not have her sash?

How do we know neutrons have no charge?

I reverse the source code, you reverse the input!

Is there no "respectively" in german language when listing (enumerating) something?

What would influence an alien race to map their planet in a way other than the traditional map of the Earth

What happens to a net with the Returning Weapon artificer infusion after it hits?



Get state from multi screen to one screen?


How to get the browser to navigate to URL in JavaScriptResetting the navigation stack for the home screen (React Navigation and React Native)react native navigator:Undefined is not an object(evaluating this.props.navigation.navigate)React Native navigation - undefined is not an objectReact Navigation: 'navigation.state.params' is always undefined in 'static navigationOptions'Navigate to another screen from Flat list item getting pressedNot able to navigate to other page in react nativeModalFilterPicker load more on scrollnavigate from another screen on click navigationDrawerLayout menuUnable to pass params successfully to another .js file/screen






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I'm quite new with React native. I want to set information include Add, Edit and Show detail on one screen, so I set state for each event when it's called.



When adding, I set isAdding, when editing, I set isEditing and when show details I set isShowDetail and navigate them, like this.



Screen A:



this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, invoice, isEditing: true );


and Screen B (Details):



constructor(props) {
super(props);
this.isShowDetail = props.navigation.getParam("isShowDetail");
console.log(this.isShowDetail);
this.isAdding = props.navigation.getParam("isAdding")
this.isEditing = props.navigation.getParam("isEditing");
const params = = this.props.navigation.state;
const invoice = = params;
const paid = 0, incurred = 0, transportFee = 0, id = invoice;
this.state =
id,
invoice,
isShowTicketDetail: false,
customer: ,
paid,
incurred,
transportFee,
details: ,
;


I don't know how to get isEditing and isAdding value, it returns undefined.



ROUTE_INVOICE_DETAIL_NAME is declared and I'm sure that it goes to Detail.










share|improve this question


























  • It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

    – Michael Marvick
    Mar 28 at 18:37











  • Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

    – Michael Marvick
    Mar 28 at 18:39


















-1















I'm quite new with React native. I want to set information include Add, Edit and Show detail on one screen, so I set state for each event when it's called.



When adding, I set isAdding, when editing, I set isEditing and when show details I set isShowDetail and navigate them, like this.



Screen A:



this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, invoice, isEditing: true );


and Screen B (Details):



constructor(props) {
super(props);
this.isShowDetail = props.navigation.getParam("isShowDetail");
console.log(this.isShowDetail);
this.isAdding = props.navigation.getParam("isAdding")
this.isEditing = props.navigation.getParam("isEditing");
const params = = this.props.navigation.state;
const invoice = = params;
const paid = 0, incurred = 0, transportFee = 0, id = invoice;
this.state =
id,
invoice,
isShowTicketDetail: false,
customer: ,
paid,
incurred,
transportFee,
details: ,
;


I don't know how to get isEditing and isAdding value, it returns undefined.



ROUTE_INVOICE_DETAIL_NAME is declared and I'm sure that it goes to Detail.










share|improve this question


























  • It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

    – Michael Marvick
    Mar 28 at 18:37











  • Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

    – Michael Marvick
    Mar 28 at 18:39














-1












-1








-1








I'm quite new with React native. I want to set information include Add, Edit and Show detail on one screen, so I set state for each event when it's called.



When adding, I set isAdding, when editing, I set isEditing and when show details I set isShowDetail and navigate them, like this.



Screen A:



this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, invoice, isEditing: true );


and Screen B (Details):



constructor(props) {
super(props);
this.isShowDetail = props.navigation.getParam("isShowDetail");
console.log(this.isShowDetail);
this.isAdding = props.navigation.getParam("isAdding")
this.isEditing = props.navigation.getParam("isEditing");
const params = = this.props.navigation.state;
const invoice = = params;
const paid = 0, incurred = 0, transportFee = 0, id = invoice;
this.state =
id,
invoice,
isShowTicketDetail: false,
customer: ,
paid,
incurred,
transportFee,
details: ,
;


I don't know how to get isEditing and isAdding value, it returns undefined.



ROUTE_INVOICE_DETAIL_NAME is declared and I'm sure that it goes to Detail.










share|improve this question
















I'm quite new with React native. I want to set information include Add, Edit and Show detail on one screen, so I set state for each event when it's called.



When adding, I set isAdding, when editing, I set isEditing and when show details I set isShowDetail and navigate them, like this.



Screen A:



this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, invoice, isEditing: true );


and Screen B (Details):



constructor(props) {
super(props);
this.isShowDetail = props.navigation.getParam("isShowDetail");
console.log(this.isShowDetail);
this.isAdding = props.navigation.getParam("isAdding")
this.isEditing = props.navigation.getParam("isEditing");
const params = = this.props.navigation.state;
const invoice = = params;
const paid = 0, incurred = 0, transportFee = 0, id = invoice;
this.state =
id,
invoice,
isShowTicketDetail: false,
customer: ,
paid,
incurred,
transportFee,
details: ,
;


I don't know how to get isEditing and isAdding value, it returns undefined.



ROUTE_INVOICE_DETAIL_NAME is declared and I'm sure that it goes to Detail.







react-native navigation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 30 at 16:40









halfer

15.3k7 gold badges63 silver badges129 bronze badges




15.3k7 gold badges63 silver badges129 bronze badges










asked Mar 28 at 18:26









Huệ VũHuệ Vũ

115 bronze badges




115 bronze badges















  • It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

    – Michael Marvick
    Mar 28 at 18:37











  • Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

    – Michael Marvick
    Mar 28 at 18:39


















  • It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

    – Michael Marvick
    Mar 28 at 18:37











  • Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

    – Michael Marvick
    Mar 28 at 18:39

















It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

– Michael Marvick
Mar 28 at 18:37





It looks like you're using react-navigation? I'd expect props.navigation.getParam("isEditing") to get you what you want. The getParam method is a helper, and you can also see all navigation params from props.navigation.state.params -- you might try to console.log(props.navigation.state.params) and see if what you expect is there.

– Michael Marvick
Mar 28 at 18:37













Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

– Michael Marvick
Mar 28 at 18:39






Also, this is a style detail for you: But it looks like you sometimes set isEditing, sometimes set isAdding, and sometimes set isShowDetail. It wouldn't ever make sense for none of these to be set, and it wouldn't ever make sense for two or three of them to be set. I'd probably have a string param called mode or something, and set it to SHOW_DETAIL, CREATE, and EDIT. Then you don't need to check 3 different booleans, but can just check for 3 different cases of the one field.

– Michael Marvick
Mar 28 at 18:39













1 Answer
1






active

oldest

votes


















0
















On Screen A:



this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, 
invoice_data: invoice ,
isEditing: true
)


On Screen B you can get data like this :



let invoice_data = this.props.navigation.state.params.invoice_data
let isEditing = this.props.navigation.state.params.isEditing





share|improve this answer



























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404541%2fget-state-from-multi-screen-to-one-screen%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0
















    On Screen A:



    this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, 
    invoice_data: invoice ,
    isEditing: true
    )


    On Screen B you can get data like this :



    let invoice_data = this.props.navigation.state.params.invoice_data
    let isEditing = this.props.navigation.state.params.isEditing





    share|improve this answer





























      0
















      On Screen A:



      this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, 
      invoice_data: invoice ,
      isEditing: true
      )


      On Screen B you can get data like this :



      let invoice_data = this.props.navigation.state.params.invoice_data
      let isEditing = this.props.navigation.state.params.isEditing





      share|improve this answer



























        0














        0










        0









        On Screen A:



        this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, 
        invoice_data: invoice ,
        isEditing: true
        )


        On Screen B you can get data like this :



        let invoice_data = this.props.navigation.state.params.invoice_data
        let isEditing = this.props.navigation.state.params.isEditing





        share|improve this answer













        On Screen A:



        this.props.navigation.navigate(ROUTE_INVOICE_DETAIL_NAME, 
        invoice_data: invoice ,
        isEditing: true
        )


        On Screen B you can get data like this :



        let invoice_data = this.props.navigation.state.params.invoice_data
        let isEditing = this.props.navigation.state.params.isEditing






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 19:02









        Muhammad IqbalMuhammad Iqbal

        742 silver badges12 bronze badges




        742 silver badges12 bronze badges

































            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404541%2fget-state-from-multi-screen-to-one-screen%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해