From 435fb8d663ee2b937e501204be4a6fc5cc5f100a Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 11 Feb 2025 13:14:36 +0100 Subject: [PATCH] refactor: remove growthbook fragment (#58677) --- .../components/growth-book/growth-book-redux-connector.tsx | 7 +++---- client/src/components/growth-book/growth-book-wrapper.tsx | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/client/src/components/growth-book/growth-book-redux-connector.tsx b/client/src/components/growth-book/growth-book-redux-connector.tsx index 8a73a6d0f89..85e27db8993 100644 --- a/client/src/components/growth-book/growth-book-redux-connector.tsx +++ b/client/src/components/growth-book/growth-book-redux-connector.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, useEffect } from 'react'; +import { useEffect } from 'react'; import { useFeature } from '@growthbook/growthbook-react'; import { connect } from 'react-redux'; @@ -35,7 +35,7 @@ type StateProps = ReturnType; type DispatchProps = { setIsRandomCompletionThreshold: (arg: boolean) => void }; interface GrowthBookReduxConnector extends StateProps, DispatchProps { - children: ReactNode; + children: JSX.Element; } const mapDispatchToProps = { @@ -72,8 +72,7 @@ const GrowthBookReduxConnector = ({ showModalsRandomly, setIsRandomCompletionThreshold ]); - // eslint-disable-next-line react/jsx-no-useless-fragment - return <>{children}; + return children; }; export default connect( diff --git a/client/src/components/growth-book/growth-book-wrapper.tsx b/client/src/components/growth-book/growth-book-wrapper.tsx index a5575559ea0..2d1f94410dd 100644 --- a/client/src/components/growth-book/growth-book-wrapper.tsx +++ b/client/src/components/growth-book/growth-book-wrapper.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, useEffect, useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { FeatureDefinition, GrowthBook, @@ -42,7 +42,7 @@ const mapStateToProps = createSelector( type StateProps = ReturnType; interface GrowthBookWrapper extends StateProps { - children: ReactNode; + children: JSX.Element; } interface UserAttributes {