Closed mfolkeseth closed 5 years ago
props are what you call your component with:
${component.render(thoseAreProps)}
State is the component's internal state. You could also just attach state yourself, but it's cleaner to use the already provided object.
Thanks for the clearification. As i mentioned, the example in reader needs to be updated, either pass text in the render method or change props to state in the micro component constructor.
Hi,
I am curious to what the distinction is between state and props and when to use them. Am I assuming correctly that props are for external use and state for internal?
I think that the example in Readme needs to be updated as the props from microcomponent constructor returns undefined in the render function (they are oldProps). I might be totally off here, just thinking out loud 🙃