fix(compat): maintain compatConfig option in legacy functional comp (#4974)
This commit is contained in:
@@ -55,6 +55,7 @@ export function convertLegacyFunctionalComponent(comp: ComponentOptions) {
|
||||
}
|
||||
Func.props = comp.props
|
||||
Func.displayName = comp.name
|
||||
Func.compatConfig = comp.compatConfig
|
||||
// v2 functional components do not inherit attrs
|
||||
Func.inheritAttrs = false
|
||||
|
||||
|
||||
@@ -60,7 +60,11 @@ import { markAttrsAccessed } from './componentRenderUtils'
|
||||
import { currentRenderingInstance } from './componentRenderContext'
|
||||
import { startMeasure, endMeasure } from './profiling'
|
||||
import { convertLegacyRenderFn } from './compat/renderFn'
|
||||
import { globalCompatConfig, validateCompatConfig } from './compat/compatConfig'
|
||||
import {
|
||||
CompatConfig,
|
||||
globalCompatConfig,
|
||||
validateCompatConfig
|
||||
} from './compat/compatConfig'
|
||||
import { SchedulerJob } from './scheduler'
|
||||
|
||||
export type Data = Record<string, unknown>
|
||||
@@ -111,6 +115,7 @@ export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}>
|
||||
emits?: E | (keyof E)[]
|
||||
inheritAttrs?: boolean
|
||||
displayName?: string
|
||||
compatConfig?: CompatConfig
|
||||
}
|
||||
|
||||
export interface ClassComponent {
|
||||
|
||||
Reference in New Issue
Block a user