diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a95ecc8..8135621b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Update NodeJS to v16 in GitHub Actions. Refs STCOR-623. * Provide `useCallout` hook. Refs STCOR-631. * Add message to indicate user cannot access app/record. Refs STCOR-619. +* Wrapp `` in `` to avoid whole-tree re-render. Refs STCOR-635. ## [8.1.0](https://github.com/folio-org/stripes-core/tree/v8.1.0) (2022-02-11) [Full Changelog](https://github.com/folio-org/stripes-core/compare/v8.0.0...v8.1.0) diff --git a/src/Pluggable.js b/src/Pluggable.js index 542110269..863b97100 100644 --- a/src/Pluggable.js +++ b/src/Pluggable.js @@ -1,8 +1,9 @@ -import React, { useMemo } from 'react'; +import React, { Suspense, useMemo } from 'react'; import PropTypes from 'prop-types'; import { modules } from 'stripes-config'; import { withStripes } from './StripesContext'; import { ModuleHierarchyProvider } from './components'; +import { LoadingView } from '@folio/stripes-components'; const Pluggable = (props) => { const plugins = modules.plugin || []; @@ -37,7 +38,9 @@ const Pluggable = (props) => { if (cachedPlugins.length) { return cachedPlugins.map(({ plugin, Child }) => ( - + }> + + )); } @@ -47,7 +50,11 @@ const Pluggable = (props) => { // eslint-disable-next-line no-console console.error(` has ${props.children.length} children, can only return one`); } - return props.children; + return ( + }> + {props.children} + + ); }; Pluggable.propTypes = {