From dc86f2fbd439a63a2c9f2deaee38abe87a3c3bab Mon Sep 17 00:00:00 2001 From: Paul Hachmang Date: Mon, 22 Jan 2024 11:38:17 +0100 Subject: [PATCH] =?UTF-8?q?Log=20the=20related=20element=20if=20the=20Scro?= =?UTF-8?q?llerProvider=20couldn=E2=80=99t=20find=20any=20children=20durin?= =?UTF-8?q?g=20load.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/stupid-carrots-glow.md | 5 +++++ packages/framer-scroller/components/ScrollerProvider.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/stupid-carrots-glow.md diff --git a/.changeset/stupid-carrots-glow.md b/.changeset/stupid-carrots-glow.md new file mode 100644 index 0000000000..c574db64aa --- /dev/null +++ b/.changeset/stupid-carrots-glow.md @@ -0,0 +1,5 @@ +--- +"@graphcommerce/framer-scroller": patch +--- + +Log the related element if the ScrollerProvider couldn’t find any children during load. diff --git a/packages/framer-scroller/components/ScrollerProvider.tsx b/packages/framer-scroller/components/ScrollerProvider.tsx index d6676309d6..25d3ea94b9 100644 --- a/packages/framer-scroller/components/ScrollerProvider.tsx +++ b/packages/framer-scroller/components/ScrollerProvider.tsx @@ -161,7 +161,7 @@ export function ScrollerProvider(props: ScrollerProviderProps) { (children: React.ReactNode) => { const count = React.Children.count(children) if (!count && process.env.NODE_ENV !== 'production') - console.warn('[@graphcommerce/framer-scroller]: Can not find children') + console.warn('[@graphcommerce/framer-scroller]: Can not find children', scrollerRef.current) const itemsArr: unknown[] = items.get().slice() itemsArr.length = count