Skip to content

Commit

Permalink
initial feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mabaasit committed Sep 20, 2024
1 parent 847482c commit 49cfe1d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
6 changes: 2 additions & 4 deletions packages/compass-aggregations/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
11 changes: 8 additions & 3 deletions packages/compass-crud/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
6 changes: 2 additions & 4 deletions packages/compass-indexes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
6 changes: 2 additions & 4 deletions packages/compass-schema-validation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
11 changes: 8 additions & 3 deletions packages/compass-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 49cfe1d

Please sign in to comment.