From c6107a91890cbe5d8ccf822f8c14fd272bfbc8ac Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 26 Oct 2022 22:51:16 -0700 Subject: [PATCH] Add data attribute to div to distinguish it (#41889) Makes it clearer why this is added by Next.js and allows searching for it in the docs. You can learn more about why here: https://beta.nextjs.org/docs/routing/linking-and-navigating#focus-and-scroll-management ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --- packages/next/client/components/layout-router.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/client/components/layout-router.tsx b/packages/next/client/components/layout-router.tsx index af60ee6aa75a07e..5a4e27caa5bc061 100644 --- a/packages/next/client/components/layout-router.tsx +++ b/packages/next/client/components/layout-router.tsx @@ -240,7 +240,9 @@ export function InnerLayoutRouter({ // Ensure root layout is not wrapped in a div as the root layout renders `` return rootLayoutIncluded ? ( -
{subtree}
+
+ {subtree} +
) : ( subtree )