Rendering of component on unsed prop updation












1















I have been wondering if a component gets rendered again if the a prop is updated and its not being used in render method.
I am using Redux and some unnecessary props have been added to the component with mapStateToProps of connect method. I know I should remove the prop if they are not used, but before I wanted to be sure if it makes any difference.










share|improve this question




















  • 1





    Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

    – Craws
    Nov 22 '18 at 9:10
















1















I have been wondering if a component gets rendered again if the a prop is updated and its not being used in render method.
I am using Redux and some unnecessary props have been added to the component with mapStateToProps of connect method. I know I should remove the prop if they are not used, but before I wanted to be sure if it makes any difference.










share|improve this question




















  • 1





    Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

    – Craws
    Nov 22 '18 at 9:10














1












1








1








I have been wondering if a component gets rendered again if the a prop is updated and its not being used in render method.
I am using Redux and some unnecessary props have been added to the component with mapStateToProps of connect method. I know I should remove the prop if they are not used, but before I wanted to be sure if it makes any difference.










share|improve this question
















I have been wondering if a component gets rendered again if the a prop is updated and its not being used in render method.
I am using Redux and some unnecessary props have been added to the component with mapStateToProps of connect method. I know I should remove the prop if they are not used, but before I wanted to be sure if it makes any difference.







reactjs redux react-redux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 10:14









Craws

333118




333118










asked Nov 22 '18 at 8:58









RizvanRizvan

132115




132115








  • 1





    Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

    – Craws
    Nov 22 '18 at 9:10














  • 1





    Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

    – Craws
    Nov 22 '18 at 9:10








1




1





Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

– Craws
Nov 22 '18 at 9:10





Is everything clear for you now? If so please mark my answer as accepted if not, let me know!

– Craws
Nov 22 '18 at 9:10












1 Answer
1






active

oldest

votes


















2














Yes, on default it will/should rerender.



Take a look at this post:
https://stackoverflow.com/a/38678454/9254064



EDIT:
https://stackoverflow.com/a/48609609/9254064






share|improve this answer





















  • 2





    The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

    – Rizvan
    Nov 22 '18 at 9:12








  • 1





    Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

    – Craws
    Nov 22 '18 at 9:18






  • 1





    Did the last link clarify it for you?

    – Craws
    Nov 22 '18 at 11:26






  • 1





    By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

    – Rizvan
    Nov 23 '18 at 7:17






  • 2





    Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

    – Rizvan
    Nov 23 '18 at 8:51











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/3.0/"u003ecc by-sa 3.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%2f53427158%2frendering-of-component-on-unsed-prop-updation%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









2














Yes, on default it will/should rerender.



Take a look at this post:
https://stackoverflow.com/a/38678454/9254064



EDIT:
https://stackoverflow.com/a/48609609/9254064






share|improve this answer





















  • 2





    The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

    – Rizvan
    Nov 22 '18 at 9:12








  • 1





    Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

    – Craws
    Nov 22 '18 at 9:18






  • 1





    Did the last link clarify it for you?

    – Craws
    Nov 22 '18 at 11:26






  • 1





    By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

    – Rizvan
    Nov 23 '18 at 7:17






  • 2





    Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

    – Rizvan
    Nov 23 '18 at 8:51
















2














Yes, on default it will/should rerender.



Take a look at this post:
https://stackoverflow.com/a/38678454/9254064



EDIT:
https://stackoverflow.com/a/48609609/9254064






share|improve this answer





















  • 2





    The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

    – Rizvan
    Nov 22 '18 at 9:12








  • 1





    Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

    – Craws
    Nov 22 '18 at 9:18






  • 1





    Did the last link clarify it for you?

    – Craws
    Nov 22 '18 at 11:26






  • 1





    By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

    – Rizvan
    Nov 23 '18 at 7:17






  • 2





    Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

    – Rizvan
    Nov 23 '18 at 8:51














2












2








2







Yes, on default it will/should rerender.



Take a look at this post:
https://stackoverflow.com/a/38678454/9254064



EDIT:
https://stackoverflow.com/a/48609609/9254064






share|improve this answer















Yes, on default it will/should rerender.



Take a look at this post:
https://stackoverflow.com/a/38678454/9254064



EDIT:
https://stackoverflow.com/a/48609609/9254064







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 22 '18 at 9:18

























answered Nov 22 '18 at 9:04









CrawsCraws

333118




333118








  • 2





    The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

    – Rizvan
    Nov 22 '18 at 9:12








  • 1





    Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

    – Craws
    Nov 22 '18 at 9:18






  • 1





    Did the last link clarify it for you?

    – Craws
    Nov 22 '18 at 11:26






  • 1





    By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

    – Rizvan
    Nov 23 '18 at 7:17






  • 2





    Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

    – Rizvan
    Nov 23 '18 at 8:51














  • 2





    The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

    – Rizvan
    Nov 22 '18 at 9:12








  • 1





    Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

    – Craws
    Nov 22 '18 at 9:18






  • 1





    Did the last link clarify it for you?

    – Craws
    Nov 22 '18 at 11:26






  • 1





    By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

    – Rizvan
    Nov 23 '18 at 7:17






  • 2





    Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

    – Rizvan
    Nov 23 '18 at 8:51








2




2





The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

– Rizvan
Nov 22 '18 at 9:12







The given link does not clearly points to my question that is why I am not sure even now. but its was helpful.

– Rizvan
Nov 22 '18 at 9:12






1




1





Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

– Craws
Nov 22 '18 at 9:18





Excuse me, I did not read your question correctly. Please take a look at the second link in my answer. It states that a re-render will only be triggered when the specific props are passed to the specific component.

– Craws
Nov 22 '18 at 9:18




1




1





Did the last link clarify it for you?

– Craws
Nov 22 '18 at 11:26





Did the last link clarify it for you?

– Craws
Nov 22 '18 at 11:26




1




1





By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

– Rizvan
Nov 23 '18 at 7:17





By unused prop I mean the prop is not used anywhere in the components render method. I don't see anything clarifying in any link that If a prop is not being used it does not make any difference the component will render again if it changes.

– Rizvan
Nov 23 '18 at 7:17




2




2





Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

– Rizvan
Nov 23 '18 at 8:51





Okay then it means it doesn't matter if it being used or not. get it now. thanks a lot.

– Rizvan
Nov 23 '18 at 8:51




















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%2f53427158%2frendering-of-component-on-unsed-prop-updation%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

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules