You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an app that has a main layout, and then several different areas which have their own 'sub layout' (nested inside the main layout) and then further 'sub layouts'. For example something like
This works, however, if I navigate from say .../discussions/:id (which renders <Discussion /> inside DiscussionsLayout) to .../discussions (which renders <DiscussionsList /> inside DiscussionsLayout), all of the layout components (AppLayout, GroupLayout...) get re-rendered. As opposed to doing something like:
React.render(<AppLayout></AppLayout>, document.body);
// Then when a user enters a group React.render(<GroupLayout></GroupLayout>, document.getElementById("app-content"));
// When a user goes to .../discussions React.render(<DiscussionsLayout><DiscussionsList /></DiscussionsLayout>, document.getElementById("group-content"));
// When a user goes to .../discussions/:id React.render(<Discussion />, document.getElementById("discussions-content"));
This way only the template is rendered when a user navigates to .../discussions/:id, and the templates are not re-rendered.
I was wondering if there is a way to achieve something similar with ReactLayout? Basically the ability to render a component into an already rendered component.
The text was updated successfully, but these errors were encountered:
I'm building an app that has a main layout, and then several different areas which have their own 'sub layout' (nested inside the main layout) and then further 'sub layouts'. For example something like
I've managed to get this working easily by doing something like:
and then I render it the normal way:
This works, however, if I navigate from say
.../discussions/:id
(which renders<Discussion />
inside DiscussionsLayout) to.../discussions
(which renders<DiscussionsList />
inside DiscussionsLayout), all of the layout components (AppLayout, GroupLayout...) get re-rendered. As opposed to doing something like:React.render(<AppLayout></AppLayout>, document.body);
// Then when a user enters a group
React.render(<GroupLayout></GroupLayout>, document.getElementById("app-content"));
// When a user goes to
.../discussions
React.render(<DiscussionsLayout><DiscussionsList /></DiscussionsLayout>, document.getElementById("group-content"));
// When a user goes to
.../discussions/:id
React.render(<Discussion />, document.getElementById("discussions-content"));
This way only the template is rendered when a user navigates to
.../discussions/:id
, and the templates are not re-rendered.I was wondering if there is a way to achieve something similar with ReactLayout? Basically the ability to render a component into an already rendered component.
The text was updated successfully, but these errors were encountered: