Skip to content

Commit

Permalink
fix stylex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lunaruan committed Feb 11, 2022
1 parent 5318971 commit 1d81925
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ describe('Stylex plugin utils', () => {
"sources": Array [],
}
`);

expect(getStyleXData([undefined])).toMatchInlineSnapshot(`
Object {
"resolvedStyles": Object {},
"sources": Array [],
}
`);
});

it('should support simple style objects', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-devtools-shared/src/backend/StyleX/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export function crawlData(

if (isArray(data)) {
data.forEach(entry => {
if (entry == null) {
return;
}

if (isArray(entry)) {
crawlData(entry, sources, resolvedStyles);
} else {
Expand Down

0 comments on commit 1d81925

Please sign in to comment.