We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d78582 commit efa6060Copy full SHA for efa6060
packages/react-from-markup/src/rehydrator.ts
@@ -75,7 +75,13 @@ export default async (
75
const roots = Array.from(
76
// TODO: allow setting a container identifier so multiple rehydration instances can exist
77
container.querySelectorAll("[data-react-from-markup-container]")
78
- );
+ ).reduce((acc: Element[], root: Element) => {
79
+ // filter roots that are contained within other roots
80
+ if (!acc.some(r => r.contains(root))) {
81
+ acc.push(root);
82
+ }
83
+ return acc;
84
+ }, []);
85
86
// TODO: solve race condition when a second rehydrate runs
87
0 commit comments