Skip to content

Commit b703be1

Browse files
author
Andrey Okonetchnikov
committed
fix: Print a warning if Group's node wasn't found in Figma file
1 parent 1f86f73 commit b703be1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Group.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export default function Group({ nodeName, children }: INode) {
1111
>
1212
{({ data }) => {
1313
const frame = data.file.pages[0].frames[0]
14+
if (!frame.children.length) {
15+
console.warn(
16+
`No children returned from the query. Check if Figma file has a corresponding layer with name ${nodeName}`
17+
)
18+
return null
19+
}
1420
const { size, position } = frame.children[0]
1521

1622
const styles = {

0 commit comments

Comments
 (0)