From b99a277595f2991ea5a4a6247e2f26f59eda86f2 Mon Sep 17 00:00:00 2001 From: Ymbere Xavier Date: Wed, 4 Dec 2019 01:44:07 -0200 Subject: [PATCH] Fix issue with caption on bootstrap 4 Add new prop to check if bootstrap is used Update component in order to return a custom caption when bootstrap4 is in use --- packages/react-bootstrap-table2/src/caption.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/react-bootstrap-table2/src/caption.js b/packages/react-bootstrap-table2/src/caption.js index 972d929..79706a6 100644 --- a/packages/react-bootstrap-table2/src/caption.js +++ b/packages/react-bootstrap-table2/src/caption.js @@ -4,16 +4,22 @@ import PropTypes from 'prop-types'; const Caption = (props) => { if (!props.children) return null; - return ( - { props.children } + + const caption = props.bootstrap4 ? ( + {props.children} + ) : ( + {props.children} ); + + return caption; }; Caption.propTypes = { children: PropTypes.oneOfType([ PropTypes.node, PropTypes.string - ]) + ]), + bootstrap4: PropTypes.bool }; export default Caption;