From ad33f553aa8672f1ae04c26f9980f640d59d405c Mon Sep 17 00:00:00 2001 From: ahtesham-quraish Date: Tue, 18 Jul 2023 12:06:32 +0500 Subject: [PATCH] feat: add ref support in container Description: Add ref support in container component VAN-1537 --- src/Container/index.jsx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Container/index.jsx b/src/Container/index.jsx index a00b3c6e21..84f3192ac1 100644 --- a/src/Container/index.jsx +++ b/src/Container/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import RBContainer from 'react-bootstrap/Container'; import PropTypes from 'prop-types'; @@ -11,19 +11,18 @@ const SIZE_CLASS_NAMES = { xl: 'container-mw-xl', }; -function Container({ size, children, ...props }) { - return ( - - {children} - - ); -} +const Container = forwardRef(({ size, children, ...props }, ref) => ( + + {children} + +)); Container.propTypes = { ...RBContainer.propTypes,