Skip to content

Commit

Permalink
fix(vue): check for null, remove invalid type assignments for head
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed Apr 25, 2024
1 parent 7836ba4 commit 79a9e30
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/vue/src/head.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type DefineComponent, defineComponent } from 'vue'
import { defineComponent } from 'vue'

export type InertiaHead = DefineComponent<{
export type InertiaHeadProps = {
title?: string
}>
}

const Head: InertiaHead = defineComponent({
const Head = defineComponent({
props: {
title: {
type: String,
Expand All @@ -13,11 +13,11 @@ const Head: InertiaHead = defineComponent({
},
data() {
return {
provider: this.$headManager.createProvider(),
provider: this.$headManager?.createProvider(),
}
},
beforeUnmount() {
this.provider.disconnect()
this.provider?.disconnect()
},
methods: {
// @ts-expect-error
Expand Down Expand Up @@ -149,7 +149,7 @@ const Head: InertiaHead = defineComponent({
},
},
render() {
this.provider.update(
this.provider?.update(
this.renderNodes(this.$slots.default ? this.$slots.default() : [])
)
},
Expand Down

0 comments on commit 79a9e30

Please sign in to comment.