Skip to content

Commit

Permalink
Fix generate nextjs project when i18n is applied
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaionut12345 committed Dec 16, 2024
1 parent a0c0698 commit dc1791a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ const addAttributesToJSXTag = (
options: JSXGenerationOptions,
params: JSXGenerationParams
) => {
Object.keys(attrs).forEach((attrKey) => {
Object.keys(attrs ?? {}).forEach((attrKey) => {
const attributeValue = attrs[attrKey]

if (!attributeValue.type) {
return
}

switch (attributeValue.type) {
case 'dynamic':
const {
Expand Down
4 changes: 4 additions & 0 deletions packages/teleport-shared/src/utils/uidl-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ export const traverseNodes = (
fn: (node: UIDLNode | UIDLComponentStyleReference, parentNode: UIDLNode) => void,
parent: UIDLNode | null = null
) => {
if (!node.type) {
return
}

fn(node, parent)

switch (node.type) {
Expand Down

0 comments on commit dc1791a

Please sign in to comment.