Unable to set unmountOnExit: false
for Stepper
#3308
-
Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch Stepper component internal props merge make it impossible to set <Stepper pt={{stepperpanel: {transition: {unmountOnExit: false}}}}> As I understand the prop merging helpers, the latest arguments has the top priority, so, it supposed to be the client's props, not the component defaults. diff --git a/node_modules/primereact/stepper/stepper.esm.js b/node_modules/primereact/stepper/stepper.esm.js
index 2a4f8bd..9eb3b04 100644
--- a/node_modules/primereact/stepper/stepper.esm.js
+++ b/node_modules/primereact/stepper/stepper.esm.js
@@ -499,14 +499,14 @@ var Stepper = /*#__PURE__*/React__default.memo(/*#__PURE__*/React__default.forwa
}, getStepPT(step, 'header', index)));
var transitionProps = mergeProps(_objectSpread(_objectSpread({
classNames: cx('stepper.content')
- }, getStepPT(step, 'transition', index)), {}, {
+ }, {}, {
timeout: {
enter: 1000,
exit: 450
},
"in": isStepActive(index),
unmountOnExit: true
- }));
+ }, getStepPT(step, 'transition', index))));
var toggleableContentProps = mergeProps(_objectSpread({
ref: contentRef,
className: cx('stepper.toggleableContent') This issue body was partially generated by patch-package. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@vasyan what was your original goal? Is it a bug or some specific requirement you need? Should this be default in PrimeReact Stepper? |
Beta Was this translation helpful? Give feedback.
@melloware My goal is to support a case where all children are rendered at the moment the
Stepper
component is mounted.I assume the purpose of the
pt
prop is to override everything, meaning it should have the highest priority regardless of whether it could potentially break the component's regular behavior. Please correct me if I'm wrong.For reference, the React-Bootstrap API provides a similar option through the
unmountOnExit
property, which is passed to the react-transition library under the hood. You can find more details in their documentation: React-Bootstrap Tabs API.