From d55001f916265ea51640b11e0c333ae9ac5a3269 Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 18 Jul 2023 14:01:59 +0500 Subject: [PATCH] fix: add ref support in `Container` component (#2452) 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,