Skip to content

Commit

Permalink
fix: remove unnecessary structuredClone
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed May 29, 2024
1 parent 8cd9113 commit 096fa2b
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export function setupMotionComponent(

const transitionValueParsed = Number.parseInt(values[transitionKey] as string)

// TODO: extract to utility function
// Apply transition property to existing variants where applicable
for (const variantKey of ['enter', 'visible', 'visibleOnce'] as const) {
const variantConfig = config[variantKey]
Expand All @@ -144,25 +143,7 @@ export function setupMotionComponent(
const motionConfig = computed(() => {
const config = defu({}, { ...propsConfig.value }, preset.value, props.variants || {})

// for (const transitionKey of ['delay', 'duration'] as const) {
// if (!props[transitionKey]) continue

// const transitionValueParsed = Number.parseInt(props[transitionKey] as string)

// // TODO: extract to utility function
// // Apply transition property to existing variants where applicable
// for (const variantKey of ['enter', 'visible', 'visibleOnce'] as const) {
// const variantConfig = config[variantKey]

// if (variantConfig == null) continue

// variantConfig.transition ??= {}
// // @ts-expect-error `duration` does not exist on `inertia` type transitions
// variantConfig.transition[transitionKey] = transitionValueParsed
// }
// }

return applyTransitionHelpers(structuredClone({ ...config }), props)
return applyTransitionHelpers({ ...config }, props)
})

// Replay animations on component update Vue
Expand Down

0 comments on commit 096fa2b

Please sign in to comment.