Unverified Commit ef1861b0 authored by Jenny Fung's avatar Jenny Fung Committed by GitHub
Browse files

fix: Allow tab to un/mount with transition (#4312)

Also, fix documentation errors:
- Tab component docs stated that the transition prop of value 'true' would use the 'Fade' transition. Rather, the 'Fade' transition is applied by default. Otherwise, the transition prop accepts 'false' or a react-transition-group 'Transition' component.
- Replace references to v2 with v4

Refs #3497
parent 02fbc161
......@@ -32,9 +32,9 @@ const propTypes = {
},
/**
* Sets a default animation strategy for all children `<TabPane>`s. Use
* `false` to disable, `true` to enable the default `<Fade>` animation or
* a react-transition-group v2 `<Transition/>` component.
* Sets a default animation strategy for all children `<TabPane>`s.
* Defaults to `<Fade>` animation; else, use `false` to disable, or a
* custom react-transition-group `<Transition/>` component.
*
* @type {{Transition | false}}
* @default {Fade}
......
......@@ -27,9 +27,9 @@ const propTypes = {
active: PropTypes.bool,
/**
* Use animation when showing or hiding `<TabPane>`s. Use `false` to disable,
* `true` to enable the default `<Fade>` animation or
* a react-transition-group v2 `<Transition/>` component.
* Use animation when showing or hiding `<TabPane>`s. Defaults to `<Fade>`
* animation, else use `false` to disable or a react-transition-group
* `<Transition/>` component.
*/
transition: PropTypes.oneOfType([PropTypes.bool, PropTypes.elementType]),
......@@ -136,7 +136,7 @@ const TabPane = React.forwardRef((props, ref) => {
const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
if (!active && unmountOnExit) return null;
if (!active && !Transition && unmountOnExit) return null;
let pane = (
<Component
......
......@@ -29,9 +29,9 @@ const propTypes = {
variant: PropTypes.string,
/**
* Sets a default animation strategy for all children `<TabPane>`s. Use
* `false` to disable, `true` to enable the default `<Fade>` animation or
* a react-transition-group v2 `<Transition/>` component.
* Sets a default animation strategy for all children `<TabPane>`s.
* Defaults to `<Fade>` animation, else use `false` to disable or a
* react-transition-group `<Transition/>` component.
*
* @type {Transition | false}
* @default {Fade}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment