Skip to content

Commit de68d08

Browse files
committed
perf: inject default
1 parent c9d3f7b commit de68d08

File tree

29 files changed

+35
-35
lines changed

29 files changed

+35
-35
lines changed

components/_util/store/connect.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function connect(mapStateToProps) {
2424
name: `Connect_${getDisplayName(WrappedComponent)}`,
2525
props,
2626
inject: {
27-
storeContext: { default: {} },
27+
storeContext: { default: () => ({}) },
2828
},
2929
data() {
3030
this.store = this.storeContext.store;

components/anchor/AnchorLink.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export default {
1515
href: '#',
1616
}),
1717
inject: {
18-
antAnchor: { default: {} },
19-
antAnchorContext: { default: {} },
18+
antAnchor: { default: () => ({}) },
19+
antAnchorContext: { default: () => ({}) },
2020
},
2121

2222
mounted() {

components/cascader/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ const Cascader = {
142142
event: 'change',
143143
},
144144
inject: {
145-
configProvider: { default: {} },
146-
localeData: { default: {} },
145+
configProvider: { default: () => ({}) },
146+
localeData: { default: () => ({}) },
147147
},
148148
data() {
149149
this.cachedOptions = [];

components/checkbox/Checkbox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default {
2727
prop: 'checked',
2828
},
2929
inject: {
30-
checkboxGroupContext: { default: null },
30+
checkboxGroupContext: { default: () => null },
3131
},
3232
methods: {
3333
handleChange(event) {

components/drawer/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Drawer = {
3535
},
3636
inject: {
3737
parentDrawer: {
38-
default: null,
38+
default: () => null,
3939
},
4040
},
4141
provide() {

components/dropdown/dropdown-button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434
event: 'visibleChange',
3535
},
3636
inject: {
37-
configProvider: { default: {} },
37+
configProvider: { default: () => ({}) },
3838
},
3939
render() {
4040
const {

components/dropdown/dropdown.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Dropdown = {
2121
event: 'visibleChange',
2222
},
2323
inject: {
24-
configProvider: { default: {} },
24+
configProvider: { default: () => ({}) },
2525
},
2626
methods: {
2727
getTransitionName() {

components/form/FormItem.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import BaseMixin from '../_util/BaseMixin';
1919
import { cloneElement, cloneVNodes } from '../_util/vnode';
2020
import Icon from '../icon';
2121

22-
function noop(){}
22+
function noop() {}
2323
export const FormItemProps = {
2424
id: PropTypes.string,
2525
prefixCls: PropTypes.string,
@@ -46,8 +46,8 @@ export default {
4646
colon: true,
4747
}),
4848
inject: {
49-
FormProps: { default: {} },
50-
decoratorFormProps: { default: {} },
49+
FormProps: { default: () => ({}) },
50+
decoratorFormProps: { default: () => ({}) },
5151
collectFormItemContext: { default: () => noop },
5252
},
5353
data() {

components/grid/Col.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
name: 'ACol',
3333
inject: {
3434
rowContext: {
35-
default: null,
35+
default: () => null,
3636
},
3737
},
3838
render() {

components/layout/Sider.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default {
108108
};
109109
},
110110
inject: {
111-
siderHook: { default: {} },
111+
siderHook: { default: () => ({}) },
112112
},
113113
// getChildContext() {
114114
// return {

0 commit comments

Comments
 (0)