refactor(createComponent): rename to defineComponent (#549)
This commit is contained in:
@@ -2,7 +2,7 @@ import { expectError } from 'tsd'
|
||||
import {
|
||||
describe,
|
||||
h,
|
||||
createComponent,
|
||||
defineComponent,
|
||||
ref,
|
||||
Fragment,
|
||||
Portal,
|
||||
@@ -71,8 +71,8 @@ describe('h inference w/ plain object component', () => {
|
||||
expectError(h(Foo, { foo: 1 }))
|
||||
})
|
||||
|
||||
describe('h inference w/ createComponent', () => {
|
||||
const Foo = createComponent({
|
||||
describe('h inference w/ defineComponent', () => {
|
||||
const Foo = defineComponent({
|
||||
props: {
|
||||
foo: String,
|
||||
bar: {
|
||||
@@ -93,8 +93,8 @@ describe('h inference w/ createComponent', () => {
|
||||
expectError(h(Foo, { bar: 1, foo: 1 }))
|
||||
})
|
||||
|
||||
describe('h inference w/ createComponent + optional props', () => {
|
||||
const Foo = createComponent({
|
||||
describe('h inference w/ defineComponent + optional props', () => {
|
||||
const Foo = defineComponent({
|
||||
setup(_props: { foo?: string; bar: number }) {}
|
||||
})
|
||||
|
||||
@@ -109,8 +109,8 @@ describe('h inference w/ createComponent + optional props', () => {
|
||||
expectError(h(Foo, { bar: 1, foo: 1 }))
|
||||
})
|
||||
|
||||
describe('h inference w/ createComponent + direct function', () => {
|
||||
const Foo = createComponent((_props: { foo?: string; bar: number }) => {})
|
||||
describe('h inference w/ defineComponent + direct function', () => {
|
||||
const Foo = defineComponent((_props: { foo?: string; bar: number }) => {})
|
||||
|
||||
h(Foo, { bar: 1 })
|
||||
h(Foo, { bar: 1, foo: 'ok' })
|
||||
|
||||
Reference in New Issue
Block a user