Skip to content

Navigation Menu

Sign in
Sign up

Commit c042d67

Browse files
fix[gen1-react]: passing custom breakpoints down to symbol (BuilderIO#4128)
## Description when we passed content of symbol down - we do a deepClone and here we were skipping `meta` field that contains the breakpoints object i think it's safe to clone meta field too? Jira https://builder-io.atlassian.net/browse/ENG-10131 loom: https://www.loom.com/share/c31a74790c6d4aac9d9375dcf8a3ce69
1 parent 957583c commit c042d67

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎.changeset/nervous-rabbits-sing.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@builder.io/react": patch
3+
---
4+
5+
fix passing down custom breakpoints to Symbol

‎packages/react/src/components/builder-block.component.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ export function deepCloneWithConditions<T = any>(obj: T): T {
4141
const clonedObj: any = {};
4242

4343
for (const key in obj) {
44-
if (key !== 'meta' && Object.prototype.hasOwnProperty.call(obj, key)) {
45-
clonedObj[key] = deepCloneWithConditions(obj[key]);
44+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
45+
if (key === 'meta') {
46+
clonedObj.meta = obj['meta'];
47+
} else {
48+
clonedObj[key] = deepCloneWithConditions(obj[key]);
49+
}
4650
}
4751
}
4852

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /