Skip to content

Commit 4aa522a

Browse files
committed
add componentDeprecationWarn to LogService
1 parent b7c2072 commit 4aa522a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/services/LogService.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ function warn(message: string) {
66

77
function deprecationWarn({component, oldProp, newProp}: {component: string; oldProp: string; newProp?: string}) {
88
const message = newProp
9-
? `uilib's ${component} "${oldProp}" prop will be deprecated soon, please use the "${newProp}" prop instead`
10-
: `uilib's ${component} "${oldProp}" prop will be deprecated soon, please stop using it`
11-
;
9+
? `RNUILib's ${component} "${oldProp}" prop will be deprecated soon, please use the "${newProp}" prop instead`
10+
: `RNUILib's ${component} "${oldProp}" prop will be deprecated soon, please stop using it`;
11+
warn(message);
12+
}
13+
14+
function componentDeprecationWarn({oldComponent, newComponent}: {oldComponent: string; newComponent: string}) {
15+
const message = `RNUILib's ${oldComponent} component will be deprecated soon, please use the "${newComponent}" component instead`;
16+
1217
warn(message);
1318
}
1419

1520
export default {
1621
warn,
17-
deprecationWarn
22+
deprecationWarn,
23+
componentDeprecationWarn
1824
};

0 commit comments

Comments
 (0)