Skip to content

Commit f2bc78f

Browse files
update optionManager.factory :
fix react warning which was about panelComponent property
1 parent 621c086 commit f2bc78f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/utils/api/optionManager/optionManager.factory.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ OptionManager.prototype.setOption = function (name = missingParamEr('setOption')
2424
OptionManager.prototype.validatePanelComponent = function (tabData) {
2525
// convert panel element into a function component.
2626
if (tabData.panelComponent && typeof tabData.panelComponent !== 'function' && React.isValidElement(tabData.panelComponent)) {
27-
tabData.panelComponent = function (props) {
28-
const PanelElement = tabData.panelComponent;
29-
return PanelElement;
30-
};
27+
const PanelElement = tabData.panelComponent;
28+
tabData.panelComponent = function (props) { return PanelElement; };
3129
}
3230
return this;
3331
};

0 commit comments

Comments
 (0)