Skip to content

Commit

Permalink
feat(ActionBar): warn when not a direct child of Page
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Mar 11, 2020
1 parent 07f43e3 commit c6f9a5e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/runtime/src/components/ActionBar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FunctionalComponent, h } from '@vue/runtime-core'
import { FunctionalComponent, h, warn } from '@vue/runtime-core'
import { NSVElement } from '../nodes'
import {
ActionBar as TNSActionBar,
Expand Down Expand Up @@ -59,7 +59,12 @@ export const ActionBar: FunctionalComponent = (props, ctx) => {
if (parent.nativeView instanceof TNSPage) {
parent.nativeView.actionBar = actionBar
} else {
// todo: warn ActionBar must be a direct child of <Page>
if (__DEV__) {
warn(
`<ActionBar> must be a direct child of a <Page> element - ` +
`got <${parent.nativeView.constructor.name}> instead.`
)
}
}
}
},
Expand Down

0 comments on commit c6f9a5e

Please sign in to comment.