diff --git a/packages/compass-aggregations/src/index.ts b/packages/compass-aggregations/src/index.ts index 0966786c3b9..dc3b0b70850 100644 --- a/packages/compass-aggregations/src/index.ts +++ b/packages/compass-aggregations/src/index.ts @@ -34,10 +34,8 @@ import { AggregationsPluginName } from './plugin-name'; const CompassAggregationsHadronPlugin = registerHadronPlugin( { name: 'CompassAggregations', - component: function AggregationsProvider({ children, ...props }) { - return React.isValidElement(children) - ? React.cloneElement(children, props) - : null; + component: function AggregationsProvider({ children }) { + return React.createElement(React.Fragment, null, children); }, activate: activateAggregationsPlugin, }, diff --git a/packages/compass-crud/src/index.ts b/packages/compass-crud/src/index.ts index f6167b7bc35..95e2da3df8c 100644 --- a/packages/compass-crud/src/index.ts +++ b/packages/compass-crud/src/index.ts @@ -38,9 +38,14 @@ const CompassDocumentsHadronPlugin = registerHadronPlugin( { name: 'CompassDocuments', component: function CrudProvider({ children, ...props }) { - return React.isValidElement(children) - ? React.cloneElement(children, props) - : null; + return React.createElement( + React.Fragment, + null, + // Cloning children with props is a workaround for reflux store. + React.isValidElement(children) + ? React.cloneElement(children, props) + : null + ); }, activate: activateDocumentsPlugin, }, diff --git a/packages/compass-indexes/src/index.ts b/packages/compass-indexes/src/index.ts index 772d1a75704..6ac7890f502 100644 --- a/packages/compass-indexes/src/index.ts +++ b/packages/compass-indexes/src/index.ts @@ -21,10 +21,8 @@ import { IndexesPluginName } from './plugin-name'; const CompassIndexesHadronPlugin = registerHadronPlugin( { name: 'CompassIndexes', - component: function IndexesProvider({ children, ...props }) { - return React.isValidElement(children) - ? React.cloneElement(children, props) - : null; + component: function IndexesProvider({ children }) { + return React.createElement(React.Fragment, null, children); }, activate: activateIndexesPlugin, }, diff --git a/packages/compass-schema-validation/src/index.ts b/packages/compass-schema-validation/src/index.ts index cf04ae45fdc..b65066003d3 100644 --- a/packages/compass-schema-validation/src/index.ts +++ b/packages/compass-schema-validation/src/index.ts @@ -16,10 +16,8 @@ import { SchemaValidationPluginName } from './plugin-name'; const CompassSchemaValidationHadronPlugin = registerHadronPlugin( { name: 'CompassSchemaValidationPlugin', - component: function SchemaValidationsProvider({ children, ...props }) { - return React.isValidElement(children) - ? React.cloneElement(children, props) - : null; + component: function SchemaValidationsProvider({ children }) { + return React.createElement(React.Fragment, null, children); }, activate: onActivated, }, diff --git a/packages/compass-schema/src/index.ts b/packages/compass-schema/src/index.ts index 26be12f5129..f2d261270ec 100644 --- a/packages/compass-schema/src/index.ts +++ b/packages/compass-schema/src/index.ts @@ -19,9 +19,14 @@ const CompassSchemaHadronPlugin = registerHadronPlugin( { name: 'CompassSchemaPlugin', component: function SchemaProvider({ children, ...props }) { - return React.isValidElement(children) - ? React.cloneElement(children, props) - : null; + return React.createElement( + React.Fragment, + null, + // Cloning children with props is a workaround for reflux store. + React.isValidElement(children) + ? React.cloneElement(children, props) + : null + ); }, activate: activateSchemaPlugin, },