question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render parent component from child component

See original GitHub issue

Background and Motivation

@javiercn say I have a component (Foo) currently displayed on a page. Then I decide all instances of Foo should be rendered inside a container (<div>). Do it manually sounds great when Foo is just being used few times, but not ideal if usability is high. Then, I create a Parent component to render the container and I make Foo to inherit Parent. The idea is any time Foo is rendered it should also render the parent it inherits from. The big question is, Is this possible today? The way BuildRenderTree works is forward only (if I’m not mistaken), thus it renders parent then child. I haven’t seen child then parent.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mrpmorriscommented, Jun 9, 2021

Create a question on StackOverflow explaining what you want to achieve (not how you are trying to achieve it) and post a link here

0reactions
msftbot[bot]commented, Jun 11, 2021

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to re render parent component when anything ...
To rerender the parent you have a couple options: you can change parent's state(triggering an update) or you can forcibly trigger an update....
Read more >
In React, how do you re-render a parent from a child ...
In React, re-rendering a parent component from a child component involves using a combination of state management and props. However, it's important to...
Read more >
The mystery of React Element, children, parents and re ...
Looking into what is React Element, exploring various children vs parents relationship in React, and how they affect re-renders.
Read more >
How to pass data from child component to its parent in ...
In the parent component, create a callback function. · Pass the callback function to the child as a props from the parent component....
Read more >
Re-render Parent Component : r/reactjs
Re-render Parent Component · Either place and handle all functionality from you parent component by passing them through the props. · Or manage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found