The correct way of assigning props for child componentReact – the right way to pass form element state to sibling/parent elements?Understanding unique keys for array children in React.jsHow to pass props to this.props.childrenReact props to child componentReact Component wait for required props to renderEnzyme test - Prop values are not assigning for child componentUpdating Child Component Via Change of Props from Parent in ReactReactDOM.render does not update containers propsA React child component that sets this.properties of its parentHow to wait for props of the parent component in the constructor of the child component

How fast can a ship with rotating habitats be accelerated?

Why cruise at 7000' in an A319?

Analog is Obtuse!

How should I behave to assure my friends that I am not after their money?

Was "I have the farts, again" broadcast from the Moon to the whole world?

A player is constantly pestering me about rules, what do I do as a DM?

Do sudoku answers always have a single minimal clue set?

Does the UK have a written constitution?

Should I include salary information on my CV?

How to modify the uneven space between separate loop cuts, while they are already cut?

Should I hide continue button until tasks are completed?

How to convert object fill in to fine lines?

Would adding an external lens allow one area outside the focal plane to be in focus?

Is this the golf ball that Alan Shepard hit on the Moon?

Forgot chonantanu after already making havdalah over wine

If a high rpm motor is run at lower rpm, will it produce more torque?

The difference between Rad1 and Rfd1

I played my first (rapid) tournament recently and I wanted to calculate my ELO

Disabling automatic add after resolving git conflict

What is the best delay to use between characters sent to the serial port

How can I create ribbons like these in Microsoft word 2010?

One folder two different locations on ubuntu 18.04

MH370 blackbox - is it still possible to retrieve data from it?

How hard is it to sell a home which is currently mortgaged?



The correct way of assigning props for child component


React – the right way to pass form element state to sibling/parent elements?Understanding unique keys for array children in React.jsHow to pass props to this.props.childrenReact props to child componentReact Component wait for required props to renderEnzyme test - Prop values are not assigning for child componentUpdating Child Component Via Change of Props from Parent in ReactReactDOM.render does not update containers propsA React child component that sets this.properties of its parentHow to wait for props of the parent component in the constructor of the child component






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








1















I wonder which way of assigning props which are going to be passed to a child component is correct (both in React correctness (syntax, common practices) and also efficiency), and if there is a much better way of achieveing this, please let me know.



So, currently in my project I have a parent component which gets some data and pass it to a child (I'm actually going to encapsulate it even further and have a child gets the data, but I'm still curious about the proper solution).



My code is something like this:



class Dashboard extends Component 

constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'




someFunction = () =>



render()
let childData = this.state.stats
childData.function = this.someFunction

return (
<div>
<ChildComponent ...childData/>
</div>
)




As you may see I assign all the data for the child component inside render(), and there is no specific reason for it really. I've seen this on one video on Lynda, while watching React stuff and I liked it. I believe I could just do this:



constructor(props) 
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'



let childData = this.state.stats
childData.function = this.someFunction



I would like to know which of those, if any, is more "react" way of doing this, or is there a better way? Am I right thinking that there may be a performance issue, with those data being assigned every single time the parent component is rendered? If so, is this going to be minimized if I move the logic to constructor, so the assignment happens only once?



Thanks for help!










share|improve this question






















  • What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

    – azium
    Mar 25 at 11:30











  • @azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

    – Irek
    Mar 25 at 12:04

















1















I wonder which way of assigning props which are going to be passed to a child component is correct (both in React correctness (syntax, common practices) and also efficiency), and if there is a much better way of achieveing this, please let me know.



So, currently in my project I have a parent component which gets some data and pass it to a child (I'm actually going to encapsulate it even further and have a child gets the data, but I'm still curious about the proper solution).



My code is something like this:



class Dashboard extends Component 

constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'




someFunction = () =>



render()
let childData = this.state.stats
childData.function = this.someFunction

return (
<div>
<ChildComponent ...childData/>
</div>
)




As you may see I assign all the data for the child component inside render(), and there is no specific reason for it really. I've seen this on one video on Lynda, while watching React stuff and I liked it. I believe I could just do this:



constructor(props) 
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'



let childData = this.state.stats
childData.function = this.someFunction



I would like to know which of those, if any, is more "react" way of doing this, or is there a better way? Am I right thinking that there may be a performance issue, with those data being assigned every single time the parent component is rendered? If so, is this going to be minimized if I move the logic to constructor, so the assignment happens only once?



Thanks for help!










share|improve this question






















  • What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

    – azium
    Mar 25 at 11:30











  • @azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

    – Irek
    Mar 25 at 12:04













1












1








1








I wonder which way of assigning props which are going to be passed to a child component is correct (both in React correctness (syntax, common practices) and also efficiency), and if there is a much better way of achieveing this, please let me know.



So, currently in my project I have a parent component which gets some data and pass it to a child (I'm actually going to encapsulate it even further and have a child gets the data, but I'm still curious about the proper solution).



My code is something like this:



class Dashboard extends Component 

constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'




someFunction = () =>



render()
let childData = this.state.stats
childData.function = this.someFunction

return (
<div>
<ChildComponent ...childData/>
</div>
)




As you may see I assign all the data for the child component inside render(), and there is no specific reason for it really. I've seen this on one video on Lynda, while watching React stuff and I liked it. I believe I could just do this:



constructor(props) 
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'



let childData = this.state.stats
childData.function = this.someFunction



I would like to know which of those, if any, is more "react" way of doing this, or is there a better way? Am I right thinking that there may be a performance issue, with those data being assigned every single time the parent component is rendered? If so, is this going to be minimized if I move the logic to constructor, so the assignment happens only once?



Thanks for help!










share|improve this question














I wonder which way of assigning props which are going to be passed to a child component is correct (both in React correctness (syntax, common practices) and also efficiency), and if there is a much better way of achieveing this, please let me know.



So, currently in my project I have a parent component which gets some data and pass it to a child (I'm actually going to encapsulate it even further and have a child gets the data, but I'm still curious about the proper solution).



My code is something like this:



class Dashboard extends Component 

constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'




someFunction = () =>



render()
let childData = this.state.stats
childData.function = this.someFunction

return (
<div>
<ChildComponent ...childData/>
</div>
)




As you may see I assign all the data for the child component inside render(), and there is no specific reason for it really. I've seen this on one video on Lynda, while watching React stuff and I liked it. I believe I could just do this:



constructor(props) 
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd'



let childData = this.state.stats
childData.function = this.someFunction



I would like to know which of those, if any, is more "react" way of doing this, or is there a better way? Am I right thinking that there may be a performance issue, with those data being assigned every single time the parent component is rendered? If so, is this going to be minimized if I move the logic to constructor, so the assignment happens only once?



Thanks for help!







reactjs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 11:13









IrekIrek

1129 bronze badges




1129 bronze badges












  • What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

    – azium
    Mar 25 at 11:30











  • @azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

    – Irek
    Mar 25 at 12:04

















  • What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

    – azium
    Mar 25 at 11:30











  • @azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

    – Irek
    Mar 25 at 12:04
















What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

– azium
Mar 25 at 11:30





What are you building and for what target(s)? knowing this will provide us more info to help you hit the right performance

– azium
Mar 25 at 11:30













@azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

– Irek
Mar 25 at 12:04





@azium it's going to be a website displaying real-time changes in the physical assembly process. Changes are being sent from the backend running on NodeJS, via websockets. Both front-end and back-end are run on the Windows-powered PC. The specific page (from the question) will be displayed on large screen tv, through raspberryPi, hence I'm trying to make it as performance-light/correct as possible. I've been told at wok that raspberryPi may struggle showing pages in React because of the rendering, not sure how much truth is in that though

– Irek
Mar 25 at 12:04












2 Answers
2






active

oldest

votes


















1














So I would say neither of those options are "the React way". Taking your exact component I would say the following is most common:



class Dashboard extends Component 
constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,



someFunction = () =>

render()
return (
<div>
<ChildComponent
stats=this.state.stats
handleSomeEvent=this.someFunction
/>
</div>
)




However that is only the most common way pre version 16.8. The most common way now would be this instead:



function Dashboard() 
const [state, setState] = useState(
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,
)

const someFunction = () =>

return (
<div>
<ChildComponent
stats=state.stats
handleSomeEvent=someFunction
/>
</div>
)






share|improve this answer























  • I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

    – Irek
    Mar 25 at 12:09


















1














Yes it can be a correct way.



The expensive part is manipulating the DOM. The performance hit is mitigated by React and you can go a long way to help by using PureComponent or the memo function to declare your child component.



Pure components and memoized functional components do a shallow compare and are only re-rendered if the shallow compare fails. The shallow compare is done in shouldComponentUpdate for PureComponent. You can also implement your own shouldComponentUpdate function in a "normal" Component. If this returns false your child component will not re-render.



So to reiterate.
Does assigning properties to child components create overhead - Yes, however, this is not a lot compared to the other overhead your application will face.



As for a non-React specific answer. Code should be readable and understandable. Creating an intermediate object just to destructure it does not make a lot of sense.



So this:



let childData = this.state.stats
childData.function = this.someFunction


Is not really needed. Rather assign directly to your component






share|improve this answer























  • Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

    – Irek
    Mar 25 at 12:06












  • yeah, as @azium has it.

    – Leon
    Mar 25 at 23:49













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%2f55336536%2fthe-correct-way-of-assigning-props-for-child-component%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














So I would say neither of those options are "the React way". Taking your exact component I would say the following is most common:



class Dashboard extends Component 
constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,



someFunction = () =>

render()
return (
<div>
<ChildComponent
stats=this.state.stats
handleSomeEvent=this.someFunction
/>
</div>
)




However that is only the most common way pre version 16.8. The most common way now would be this instead:



function Dashboard() 
const [state, setState] = useState(
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,
)

const someFunction = () =>

return (
<div>
<ChildComponent
stats=state.stats
handleSomeEvent=someFunction
/>
</div>
)






share|improve this answer























  • I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

    – Irek
    Mar 25 at 12:09















1














So I would say neither of those options are "the React way". Taking your exact component I would say the following is most common:



class Dashboard extends Component 
constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,



someFunction = () =>

render()
return (
<div>
<ChildComponent
stats=this.state.stats
handleSomeEvent=this.someFunction
/>
</div>
)




However that is only the most common way pre version 16.8. The most common way now would be this instead:



function Dashboard() 
const [state, setState] = useState(
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,
)

const someFunction = () =>

return (
<div>
<ChildComponent
stats=state.stats
handleSomeEvent=someFunction
/>
</div>
)






share|improve this answer























  • I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

    – Irek
    Mar 25 at 12:09













1












1








1







So I would say neither of those options are "the React way". Taking your exact component I would say the following is most common:



class Dashboard extends Component 
constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,



someFunction = () =>

render()
return (
<div>
<ChildComponent
stats=this.state.stats
handleSomeEvent=this.someFunction
/>
</div>
)




However that is only the most common way pre version 16.8. The most common way now would be this instead:



function Dashboard() 
const [state, setState] = useState(
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,
)

const someFunction = () =>

return (
<div>
<ChildComponent
stats=state.stats
handleSomeEvent=someFunction
/>
</div>
)






share|improve this answer













So I would say neither of those options are "the React way". Taking your exact component I would say the following is most common:



class Dashboard extends Component 
constructor(props)
super(props)

this.state =
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,



someFunction = () =>

render()
return (
<div>
<ChildComponent
stats=this.state.stats
handleSomeEvent=this.someFunction
/>
</div>
)




However that is only the most common way pre version 16.8. The most common way now would be this instead:



function Dashboard() 
const [state, setState] = useState(
a: 'foo',
b: 'bar',
stats:
c: 'c',
d: 'd',
,
)

const someFunction = () =>

return (
<div>
<ChildComponent
stats=state.stats
handleSomeEvent=someFunction
/>
</div>
)







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 11:26









aziumazium

12.7k3 gold badges33 silver badges55 bronze badges




12.7k3 gold badges33 silver badges55 bronze badges












  • I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

    – Irek
    Mar 25 at 12:09

















  • I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

    – Irek
    Mar 25 at 12:09
















I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

– Irek
Mar 25 at 12:09





I used this method few times throughout the project and what I found out is that when you have multiple functions/variables you want to pass to children it can cause slightly long code (stack). Then I thought using spread operator and assignment (as I did above) will make the code look "prettier". Althogh, if it's the most appropriate way of doing it, I will have to change over. Thanks!

– Irek
Mar 25 at 12:09













1














Yes it can be a correct way.



The expensive part is manipulating the DOM. The performance hit is mitigated by React and you can go a long way to help by using PureComponent or the memo function to declare your child component.



Pure components and memoized functional components do a shallow compare and are only re-rendered if the shallow compare fails. The shallow compare is done in shouldComponentUpdate for PureComponent. You can also implement your own shouldComponentUpdate function in a "normal" Component. If this returns false your child component will not re-render.



So to reiterate.
Does assigning properties to child components create overhead - Yes, however, this is not a lot compared to the other overhead your application will face.



As for a non-React specific answer. Code should be readable and understandable. Creating an intermediate object just to destructure it does not make a lot of sense.



So this:



let childData = this.state.stats
childData.function = this.someFunction


Is not really needed. Rather assign directly to your component






share|improve this answer























  • Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

    – Irek
    Mar 25 at 12:06












  • yeah, as @azium has it.

    – Leon
    Mar 25 at 23:49















1














Yes it can be a correct way.



The expensive part is manipulating the DOM. The performance hit is mitigated by React and you can go a long way to help by using PureComponent or the memo function to declare your child component.



Pure components and memoized functional components do a shallow compare and are only re-rendered if the shallow compare fails. The shallow compare is done in shouldComponentUpdate for PureComponent. You can also implement your own shouldComponentUpdate function in a "normal" Component. If this returns false your child component will not re-render.



So to reiterate.
Does assigning properties to child components create overhead - Yes, however, this is not a lot compared to the other overhead your application will face.



As for a non-React specific answer. Code should be readable and understandable. Creating an intermediate object just to destructure it does not make a lot of sense.



So this:



let childData = this.state.stats
childData.function = this.someFunction


Is not really needed. Rather assign directly to your component






share|improve this answer























  • Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

    – Irek
    Mar 25 at 12:06












  • yeah, as @azium has it.

    – Leon
    Mar 25 at 23:49













1












1








1







Yes it can be a correct way.



The expensive part is manipulating the DOM. The performance hit is mitigated by React and you can go a long way to help by using PureComponent or the memo function to declare your child component.



Pure components and memoized functional components do a shallow compare and are only re-rendered if the shallow compare fails. The shallow compare is done in shouldComponentUpdate for PureComponent. You can also implement your own shouldComponentUpdate function in a "normal" Component. If this returns false your child component will not re-render.



So to reiterate.
Does assigning properties to child components create overhead - Yes, however, this is not a lot compared to the other overhead your application will face.



As for a non-React specific answer. Code should be readable and understandable. Creating an intermediate object just to destructure it does not make a lot of sense.



So this:



let childData = this.state.stats
childData.function = this.someFunction


Is not really needed. Rather assign directly to your component






share|improve this answer













Yes it can be a correct way.



The expensive part is manipulating the DOM. The performance hit is mitigated by React and you can go a long way to help by using PureComponent or the memo function to declare your child component.



Pure components and memoized functional components do a shallow compare and are only re-rendered if the shallow compare fails. The shallow compare is done in shouldComponentUpdate for PureComponent. You can also implement your own shouldComponentUpdate function in a "normal" Component. If this returns false your child component will not re-render.



So to reiterate.
Does assigning properties to child components create overhead - Yes, however, this is not a lot compared to the other overhead your application will face.



As for a non-React specific answer. Code should be readable and understandable. Creating an intermediate object just to destructure it does not make a lot of sense.



So this:



let childData = this.state.stats
childData.function = this.someFunction


Is not really needed. Rather assign directly to your component







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 11:26









LeonLeon

8,7783 gold badges23 silver badges49 bronze badges




8,7783 gold badges23 silver badges49 bronze badges












  • Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

    – Irek
    Mar 25 at 12:06












  • yeah, as @azium has it.

    – Leon
    Mar 25 at 23:49

















  • Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

    – Irek
    Mar 25 at 12:06












  • yeah, as @azium has it.

    – Leon
    Mar 25 at 23:49
















Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

– Irek
Mar 25 at 12:06






Thanks for the answer with detailed exlpanation. By saying "assign directly", do you mean using the method displayed by @azium below?

– Irek
Mar 25 at 12:06














yeah, as @azium has it.

– Leon
Mar 25 at 23:49





yeah, as @azium has it.

– Leon
Mar 25 at 23:49

















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%2f55336536%2fthe-correct-way-of-assigning-props-for-child-component%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

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript