No 4. I see this all the time. Usually happens when someone wants to split out the child component logic but still requires access to shared variables. In that case you can either split them out as you have done and pass those variables as parameters, or alternatively use a class based component instead as the deceleration of those child components can still be done within the scope of the class without the re-deceleration issue. The class based option tends to be easier to manage when the child component not only reads params from the parent but needs to modify data in the parent as well. Often this is easier to manage then passing callback functions down as parameters.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

James Xabregas
James Xabregas

Written by James Xabregas

Manipulating electrons for fun and profit. Thoughts on tech, startups, politics, life. Co-founder of Braiv.co

No responses yet

Write a response